Link to home
Create AccountLog in
Avatar of jung1975
jung1975

asked on

measures with different granularity in one fact table

I have a fact table services which has  a service transaction as the lowest grain&

It has a values as a mesure

Consumer_key    date_key     values    
1                                   111                10
1                                   113                   0
1                                   113                34
1                                    123                22
1                                   145                23

I would like to add another measure : consumer_count  which has a different level of granularity.  I would to count the unique consumer _key

Can I just add a column called conumer_num with '1' stamped for every row .? And when we do the query we can bascially do  count(distinct cumsumer_num) ..  Do you see any problems with this approch?  I assume it will work for any kind of date range analysis as well&
ASKER CERTIFIED SOLUTION
Avatar of nicolasdiogo
nicolasdiogo
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Avatar of Sujith
Sujith
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account