Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using Dimension Measures - COUNT, etc.. within Fact Results

762114Jun 30 2010 — edited Jul 20 2010
All,

I am running into an issue that I imagine is relatively straight forward if you know what youre doing but I cant seem to get it right. I am trying to include some counts from my Dimensions alongside measures from my fact table.

To do this I have setup my Dimensions as Facts that I require counts from. In a simple example I have:

EVENT_FACT
Timestamp
User Id
Building Id
Event Type
existing measure = Event Count

USER_BUILDING_DIM
User Id
Building Id
Building Type

USER_BUILDER_DIM contains a record for each user and the building they are contained in along with a type. Users can exist in multiple buildings so this table's key is User Id and Building Id.

When I run a query from the FACT table I want to show the total number of Distinct Users in that build next to each result. To make this work I have done the following:
1. Setup the USER_BUILDING_DIM as a fact in my BMM, the only table that joins to this Fact table is the USER_BUILDING_DIM itself
2. In the USER_BUILDING_DIM (DIMENSION) hierarchy I have 3 levels, total, building and user ... I want my count of all users for each building
3. Created a measure called User Count - Distinct in the USER_BUILDING_DIM (FACT) table and set it to the Building level in the USER_BUILDING_DIM (DIMENSION) hierarchy. That is the only level I set for this measure

When I go into answers and I create a query like:
Building Id, Event Count, User Count - Distinct

The query comes back perfect and shows me for each building the total event count from the EVENT_FACT table and then alongside it the Distinct User count for users in that building counted from the USER_BUILDING_DIM table.

The Issue occurs when I add any other dimensions into the request that hang off of the EVENT_FACT table, such as Month from my Time Dimension which also hangs off of the EVENT_FACT table:
Month, Event Count, User Count - Distinct

Now, for the query above the User Count - Distinct value returns nothing and when I look in the logs Answers is not even performing a count anymore and instead is just joining the USER_BUILDING_DIM to the EVENT_FACT table and TIME Dimension

Any thoughts .. thanks in advance

K
This post has been answered by kart on Jul 1 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details