dbTalk Databases Forums  

Last value on current set of analisys

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Last value on current set of analisys in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Simon
 
Posts: n/a

Default 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.



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.