dbTalk Databases Forums  

last member

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


Discuss last member in the microsoft.public.sqlserver.olap forum.



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

Default last member - 11-14-2003 , 02:39 AM






Hi,

I have a time dimnesion Date(Year,Month,Week,Day) and Client dimnesion
Client(Client_number).I'd like to know the date of last transaction of
specified client?
For example:
select {[Date].Lastchild} on columns
from cube
where [Client].[CLI00001]
gives me the last year of transaction.
How can I get Day,Month and Year of last transaction?
Is it possible to get it from CUBE this way?

thx
Sobota



Reply With Quote
  #2  
Old   
Brian Altmann
 
Posts: n/a

Default last member - 11-14-2003 , 08:20 AM






The lastchild function returns the last child of a member,
in this case a Date dimension member, regardless of the
Where specification. As long as you do not add new members
to the date dimension it will always return the same
member for all clients, with or without transactions.
To find the last Date member at a specific level for which
a given measure is not empty, and assuming your measure to
be Sales, you can use an expression such as :

Tail(Filter(Date.Day.Members,not isempty
((Measures.Sales,Client.[CLI00001])))).item(0)

HTH,
Brian
www.geocities.com/brianaltmann/olap.html






Quote:
-----Original Message-----
Hi,

I have a time dimnesion Date(Year,Month,Week,Day) and
Client dimnesion
Client(Client_number).I'd like to know the date of last
transaction of
specified client?
For example:
select {[Date].Lastchild} on columns
from cube
where [Client].[CLI00001]
gives me the last year of transaction.
How can I get Day,Month and Year of last transaction?
Is it possible to get it from CUBE this way?

thx
Sobota


.


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.