Last value on current set of analisys -
04-05-2005
, 09:01 AM
Hi,
I have create a olap cube base on sales with dimensions Time (invoice data),
State, Product code and Customer, Quantity and Price as measures.
Now I need to get last invoice Price for the current set of the analisys
Ex.
Row
Date
State
Product
Quantity
Price
1
01/01/2005
IL
P1
1000
10.3
2
01/15/2005
NY
P2
1500
10.2
3
01/31/2004
CA
P1
1100
9.5
4
02/01/2005
IL
P2
1000
11.2
5
02/15/2005
NY
P1
1500
11.4
6
02/28/2004
CA
P1
1100
10
7
03/01/2005
IL
P1
1000
9.8
8
03/15/2005
NY
P1
1500
10
9
03/31/2004
CA
P2
1100
9.9
If the current set of analisys is set on Year, State & Product I need this
result:
Year
State
Product
Price
Row
2005
IL
P1
9.8
7
2005
NY
P1
10
8
2005
CA
P1
10
6
2005
IL
P2
11.2
4
2005
NY
P2
10.2
2
2005
CA
P2
9.9
9
If the current set of analisys is set on Year, State I need this result:
Year
State
Price
Row
2005
IL
9.8
7
2005
NY
10
8
2005
CA
9.9
9
If the current set of analisys is set on Month, Product I need this result:
Month
Product
Price
Row
1
P1
9.5
3
1
P2
10.2
2
2
P1
10
6
2
P2
11.2
4
3
P1
10
8
3
P2
9.9
9
If someone have an idea to make this please replay to this post.
Thanks in advance
Simon. |