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

Issue concerning transposing a wide table

3 posters

Go down

Issue concerning transposing a wide table Empty Issue concerning transposing a wide table

Post  CNP Thu Jul 03, 2014 1:42 pm

I am a newbie in this dim. model world, and on my path to master this skill I have encountered the following issue.
I have made a example with fictional data, so dont look at the data but more the concept.

I have this start table which is need to be converted into a dimensional model, so the users has access to an analytical table.

Start/input table:

ProductNoProfit10p  Profit20p  Profit30p  Marg10p  Marg20p  Marg30p  Price  
In the real example there will be 20 or 30 Profit* and Marg* columns. And its more complex with time, country and other dimensions, but my issue is concerning the Profit and Marg columns, what to do when there are so many.

What the user wants:
The user wants an analytic table where the rows profit and Marg are transposed so the table is more vertical  and slim than wide and horizontal. This is want they want, and I cant change it.
A table like this:

What im thinking about:

a fact
and a dimension
Profit(containing 10-30)
Marg (containing 10-30)
But i cant make it work...
Any other suggesting on how to handle this? I dont think the design is good. I can change the design, but I cant change what the user wants.
Are there any relevant chapters in Kimballs books which address this?


Posts : 1
Join date : 2014-07-03

Back to top Go down

Issue concerning transposing a wide table Empty Re: Issue concerning transposing a wide table

Post  ngalemmo Thu Jul 03, 2014 4:29 pm

Vertical is fine. Its the best way to handle this.

A fact table has measures and context (dimensions). From what I can see, the measures are price, profit, and margin. It's not clear what the PCT column represents, it's either a measure or a derived (calculated value).

As for dimensions, Product is one. It should just contain information about the product. You need another dimension that characterizes the measures on the row. Basically information about the cell that has been broken out, which may the the prof and marg stuff you are trying to put into the product dimension.

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

Back to top Go down

Issue concerning transposing a wide table Empty Re: Issue concerning transposing a wide table

Post  nick_white Thu Jul 03, 2014 5:11 pm

Just to throw in my opinion, for what it's worth...
A dimensional model is used for delivering reports - you create a fact table, join it to dimensions and then aggregate the measures in the fact grouped by attributes in your dimensions to produce your report.
However, your user seems to be asking you to produce a table (not a report) that effectively dumps the content of your fact table out to another table (you have the same number of records in your output table as you have in your fact table). You describe this output as an analytical table so presumably your user is then going to use this data in some subsequent process?
In my opinion either you use the dimensional model to deliver the user's complete complete reporting requirements (not just a table used as part of the reporting/analysis process) or you take this out of your dimensional model entirely. If you have the source data as you describe and you want to convert it to the target structure then do it using SQL, PL/SQL, an ETL tool or code - trying to do it via a dimensional model doesn't seem to be adding anything and is using the DM for something that it's not really designed for


Posts : 364
Join date : 2014-01-06
Location : London

Back to top Go down

Issue concerning transposing a wide table Empty Re: Issue concerning transposing a wide table

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