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

Novice question: grain level

2 posters

Go down

Novice question: grain level Empty Novice question: grain level

Post  alpha_a Mon Aug 20, 2012 11:09 am

Hello,
Please can you clarify something about the grain level in dimensions.

Suppose you have a fact table, where each fact has a sale_number, and a sale_quantity, let's say. You also have a dimension table: Location, with the following hierarchy: continent -> country -> city. The grain in this case is the city. However, obviously, in each city there can be many sales.
Then, you browse the cube using the Location dimension, you'll see Continent/Country/City and in front of it there will be sum(sale_quantity) of all sales in the city.
My question is, if you wanna have a further browsing level, where the grain is a sale (So when you browse down to city, you wanna browse further and see quantity of each sale by itself), should you include the sale as a grain level in the dimension Location for that to be possible ?

Thank you.

alpha_a

Posts : 12
Join date : 2012-07-31

Back to top Go down

Novice question: grain level Empty ...Continued...

Post  alpha_a Tue Aug 21, 2012 10:04 am

In the same topic, how do you 'browse by' fields of the fact table.
I've seen people in some instances create a dimension table based on the fact table, and then creating an attribute corresponding to each column in the fact table that they wanna use as a browsing dimension.
Is this the proper way to do it ?

thank you.

alpha_a

Posts : 12
Join date : 2012-07-31

Back to top Go down

Novice question: grain level Empty Re: Novice question: grain level

Post  sgudavalli Wed Aug 22, 2012 5:41 am


you dont need to store the sales number in dimension table
you already have it in your fact table i.e.. sales number which is a Degenerate Dimension

sgudavalli

Posts : 29
Join date : 2010-06-10
Age : 39
Location : Pune, India

Back to top Go down

Novice question: grain level Empty Re: Novice question: grain level

Post  alpha_a Wed Aug 22, 2012 6:13 am

ok, but in this case you won't be able to browse down to the sale_number when you explore the cube...

alpha_a

Posts : 12
Join date : 2012-07-31

Back to top Go down

Novice question: grain level Empty Re: Novice question: grain level

Post  sgudavalli Wed Aug 22, 2012 9:54 am

add fact table as a dimension table and relationship type should be a Fact Relationship Type

sgudavalli

Posts : 29
Join date : 2010-06-10
Age : 39
Location : Pune, India

Back to top Go down

Novice question: grain level Empty Re: Novice question: grain level

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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