LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Analyzing data in collections of classes?

I have a large data set that I need to analyze based on several factors, and
I'm thinking this /might/ be the right time to dip my toe into OOP (or as
much as VBA allows) instead of my standard linear approach. So far, the most
understandable resource I've found is
http://www.cpearson.com/excel/Classes.aspx but I'm still having trouble
conceptualizing how to set it up (and if the actual analyses I need to
perform would benefit from an OOP approach).

My source data represents many thousands of purchases, within each purchase
there will be multiple products, and within each product there will be
multiple quantities, packaging, etc. It is possible that the same product
will show up in the same order more than once, with different properties
(e.g. milk.size = 1 gallon, and milk.size = 1 pint).

So I might have instances of purchases:
purchase.date
purchase.time
purchase.amount
purchase.payment_type
purchase.membercard_number

Then within each purchase, I have instances of items:
Item.type 'veggie/dairy/produce/bulk/dry goods/pets/etc
Item.brand
item.package_size
Item.quantity
Item.onsale 'boolean

First question: In this case, purchase is more than a flat collection,
because it has it's own class properties, but also needs to function as a
collection of items. What is the proper approach to set that up?

Once I have my data loaded from my worksheet into the objects, my analysis
will be to look for specific patterns; What was the total amount of vanilla
ice cream purchased from Brand_C as compared to vanilla ice cream purchased
from Brand_X, excluding purchases where Brand_X was purchased in the same
transaction as any items from Brand_Z?

I'm thinking I could just create additional properties for each transaction
to simplify the analysis, for example,
purchase.IncludesBrandXVanillaIceCream_but_noBrand Z 'boolean
purchase.TotalDollarsOfBrandXVanillaIceCream

Does OOP (or the VBA equivalent) really make these types of analyses easier,
or should I just stick with linear data crunching?

I appreciate your advice,
Keith


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
analyzing data - accuracy assessment cmlad Excel Discussion (Misc queries) 2 September 29th 09 10:18 PM
analyzing data with VBA Nicole Knapp Excel Programming 4 February 19th 09 12:04 PM
A List of Collections and Custom Collections ExcelMonkey Excel Programming 1 December 20th 07 10:04 PM
Problem analyzing my data Amanda Excel Worksheet Functions 2 April 8th 06 04:53 AM
analyzing poll data ulfb Excel Programming 1 December 10th 04 09:27 PM


All times are GMT +1. The time now is 08:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"