Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Question for count in fact table

2 posters

Go down

Question for count in fact table Empty Question for count in fact table

Post  chade25 Mon Mar 04, 2013 2:25 pm

This is for course registration. I have students which register for courses, but the IR person was wanting a field on the fact table for reporting in Cognos, and this field would just have a 1 in it. I do not agree with doing this because you can just count distinct student identifiers. I could have a count 1 or 0 for if they should be counted as enrolled in the course, but I have a 'Y' or 'N' indicator in the registration status dimension for enrollment...what do you guys think? I dont really like saying things in multiple places...or in different ways within the same grain, but I see this as a future aggregation on registration to get the subset of "enrolled" students. I am open to opinions.


Posts : 29
Join date : 2012-04-12
Age : 44
Location : Oregon

Back to top Go down

Question for count in fact table Empty Re: Question for count in fact table

Post  ngalemmo Mon Mar 04, 2013 3:19 pm

It depends on the nature of the fact table. Most front-end tools allow you to define column expressions, doing a count versus summing a bunch of 1's makes no difference in how the query performs.

The times when I have found a count column useful is when you have transactions that initiate, adjust and terminate a status. In such cases, the column would have values of 1, 0, and -1 depending on the transaction. This allows you to easily calculate a count without having to interpret the nature of the transaction.

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum