Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Comparing facts in a table with multiple dimensions

Hi, guys!

Will appreciate any ideas. I have 25 dimensions and 5 facts. One of the dimansions is Date.

As you can imagine there are huge combinations in 25 dimansions and user can define any dimensions to be shown in a report, that means that QV must automatically aggregate data in the dimensions. The problem is that I need to compare in pivot table fact values between two dates, for example this monday and previous monday, and this pivot table must contain a date column as a dimension.

As I can see it I need to shift dates and load data in the way like this:

tmp:

load

     id

     filed1,

     filed2,

     date as 'current date',

     date-7 as 'previous date'

     sum(val) as sum

     from table1

group by field1, filed2, etc;

left join (tmp)

load

     filed1,

     filed2,

     date as 'previous date',

     sum as 'prev sum'

     resident tmp;

     

Here Id is an unique combination of dimensons. It works fine, but only if you can be sure that the combination at the current day will be meet at the previous date. In my case, as soon as i have lots of combinations of the dimensions, join doesn't work properly here

0 Replies