|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 7:09 AM
Points: 73,
Visits: 253
|
|
Hi everybody:
Right now I´m working in a BI solution and I received a set of tables with a multidimensional structure. I have a Fact table with transaction from customers and several dimensional tables. One of them is the KUNDE or customer table, in which the typical customer information is stored, like customer key, a key to another table (contact details), customer since date, etc. I also found numeric values in this table like "amount of purchases last 12 Month" or "Total shopping days" inside this table. That makes me wonder if it makes sense or not to store this measures inside the table, moreover, I'm building another table to store the customer data as a type II SCD and I´m not able to persuade the analyst to not include measures in this table.
What is your opinion about that?
Any comment would be appreciated.
Kind Regards,
Paul Hernández http://hernandezpaul.wordpress.com/ https://twitter.com/paul_eng
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 6:39 AM
Points: 9,376,
Visits: 6,472
|
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 7:09 AM
Points: 73,
Visits: 253
|
|
Thanks for your quick answer. That's exactly what I thought. I think aCRM guys are a little bit lazy and don't want to make joins. Anyway, there are a couple of values that we received from an external provider inside the Customer table that I cannot change. What I do is to create new tables and store aggregated measures in a new fact table and create also a new Customer table with the appropriate fields. Now I'll try the SCD Transfomation (SSIS 2008) that lets me treat some fields as type 1 and others as type 2.
Kind Regards,
Paul Hernández http://hernandezpaul.wordpress.com/ https://twitter.com/paul_eng
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: 2 days ago @ 5:29 AM
Points: 1,
Visits: 31
|
|
Hi Paul,
I think that storing the value " amount of purchases last 12 Month" in the dimension table is valid.Let me explain one scenario where it would be usefull.Suppose If the user has to answer the business question the top ten customers in terms of purchases for the last twelve months then in such a scenario instead of calculating those figures from the fact it would be easier to query if they are stored in the dimension table.Hope it gives a valid reason for having it in the dim table
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 6:39 AM
Points: 9,376,
Visits: 6,472
|
|
prakashsa2709 (11/1/2012) Hi Paul,
I think that storing the value " amount of purchases last 12 Month" in the dimension table is valid.Let me explain one scenario where it would be usefull.Suppose If the user has to answer the business question the top ten customers in terms of purchases for the last twelve months then in such a scenario instead of calculating those figures from the fact it would be easier to query if they are stored in the dimension table.Hope it gives a valid reason for having it in the dim table
So you would recalculate your entire customer dimension each month? What if you want history on that? Duplcate your entire customer dimension each month?
How to post forum questions. Need an answer? No, you need a question. What’s the deal with Excel & SSIS?
Member of LinkedIn. My blog at LessThanDot.
 MCSA SQL Server 2012 - MCSE Business Intelligence
|
|
|
|
|
Say Hey Kid
      
Group: General Forum Members
Last Login: Today @ 9:32 AM
Points: 671,
Visits: 1,509
|
|
I think that storing the value " amount of purchases last 12 Month" in the dimension table is valid.
I agree. If the information is there, it must be valuable to your business users. You should make that information available in the dimension.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 4:43 PM
Points: 192,
Visits: 640
|
|
One reason I think this is not a good practice is that the cardinality can be quite high. This can be valid to do if business regards this as important. A better solution is to build categories into the dimension, So those customers that purchased between 0 and n are type 1, etc...etc... As long as you dont forsee these categories changing. You can even base an attribute on if a customer is one of your top ten purchasers. I dont see an issue with reprocessing the dimension often as needed.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 2:26 AM
Points: 87,
Visits: 228
|
|
Given the use case ("amount of purchases last 12 Month"), I'd consider unlikely a user query like "amount of purchases last 12 Month" = 37, so the suggestion of categories seems adequate. But something like "amount of purchases last 12 Month" < 6 might be useful, and categories might mess this up  But it's always the matter of understanding the need for this information and how it'll be used.
PMWar
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 4:43 PM
Points: 192,
Visits: 640
|
|
"But something like "amount of purchases last 12 Month" < 6 might be useful, and categories might mess this up "
A good point but it still all fits. If the amount of people that bought 3,4,5 items is of reporting importance, then call just these categories cat3, cat4, cat5, etc.. As the number of purchases increase you can increase the span of each category in a mathematical fashion.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 4:36 AM
Points: 5,678,
Visits: 6,126
|
|
Paul,
In a case like this I would look towards chaining fact tables. I don't know the proper term, I'm not a warehouse expert, I just build 'em.
What it would look like is something like this:
(Existing Fact Tables) -> CustomerData with only attributes (Dimension) -> FactTable storing the calculated measures for date of measure taken.
You'd have to be careful about including only the most recent fact for each customer when treating it like a continuation of the dimension, but it will both allow you to monitor changes to the measures being delivered as well as separate out the concern of modifying attributes on a dimension when indeed your measures are mobile.
From there, you can have a discussion about 'better ways to achieve the same result' with your developers.
- Craig Farrell
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions | Forum Netiquette For index/tuning help, follow these directions. |Tally Tables Twitter: @AnyWayDBA
|
|
|
|