Re: Struggling with grouping results in Excel / Analysis Services -
04-30-2005
, 05:58 AM
Hi Deepak
Yes you're right. They are calculated - but they are simply
aggregations of two or three other measures or cumulatives across time
- and calculate very quickly.
(note that my time dimension is relative to the present so I base
averages on a horizon 52 weeks from now)
Thus:
My fact table has two measures - quantity and value.
Dimension keys within the fact table are transaction type, product code
and week number
There are 40,000 rows in the fact table
[all transaction types] = [opening stock] + [supply] - [demand]
[closing stock] =
sum( periodstodate([time].[(all)],[time].currentmember),
([value],[all transaction types]) )
[average weekly demand] =
sum( periodstodate([time].[(all)],[all time].firstchild.lead(52) ),
([value],[demand]) ) / 52
[stock cover] = iif( [average weekly demand] = 0, null, [closing
stock] / [average weekly demand] )
I get reasonable results - (answer in 15 seconds) if I change my
earlier calculation to
[Understocks]=
iif (isleaf([products].currentmemb*er),
iif([stock cover]>0 and [stock cover]<5,[closing stock],null), 0)
Here, I allow the aggregations to produce zero results and generate
value totals in Excel...
If I leave the subtotals as null, Excel gets horribly confused and
dies...
Does this help you to see my problem more clearly?
Ian Bamforth |