Cube definition/MDX Query help needed -
09-28-2005
, 03:44 AM
Hi all
I am new to MDX and I have a problem getting the wanted output.
Here is the deal.
The dataset looks like this (Simplified)
Customer Group, Customer, Week, AccumSales
The Output I want is this:
a.. Customer Group 1 Accum Sales 6500 (Sum of Last of
Accum sales)
a.. Customer 1 Accum Sales 3000 (Last of Accum
sales i.e. Week 3)
a.. Week 1 Accum Sales 1000
b.. Week 2 Accum Sales 2000
c.. Week 3 Accum Sales 3000
b.. Customer 2 Accum Sales 3500 (Last of Accum
sales i.e. Week 3)
a.. Week 1 Accum Sales 1500
b.. Week 2 Accum Sales 2500
c.. Week 3 Accum Sales 3500
The trick here is to sum up values in AccumSales but only if Week is the
last one within the customer.
How do I do this?
I know it is a bit weird to have AccumSales in a field in the dataset, but
this is how it is - Please do not ask me to change it :-)
Thanks
Bent |