dbTalk Databases Forums  

How to retrieve the last non empty cell in AS

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


Discuss How to retrieve the last non empty cell in AS in the microsoft.public.sqlserver.olap forum.



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

Default How to retrieve the last non empty cell in AS - 10-08-2004 , 05:39 AM






Hi,

I have a a period dimension:
2003
Jan
Feb
Mar
.....
Dec

I have the following data in the fact table:
Date Value
2003 Jan 5
2003 Feb 7
2003 Mar 6
2003 Apr
2003 May
......

There is only data up till 2003 Mar. In AS i want on year level to show this
last available value, which is 6. I've tried a calculated value on year level:

Max({[Period].children},[Measures].[NumberValue])

But this gives me the highest value of the year which is 7. Any idea how i
can get the last available value in the year?

Thnx,

Stanley

Reply With Quote
  #2  
Old   
Jamie Thomson
 
Posts: n/a

Default RE: How to retrieve the last non empty cell in AS - 10-08-2004 , 08:37 AM






Does this work?

{Tail(filter({Period.Children}, IsNull(Period.CurrentMember)}, 1)}.Item(0)

Regards
Jamie Thomson
http://www.conchango.com


"Stanley" wrote:

Quote:
Hi,

I have a a period dimension:
2003
Jan
Feb
Mar
.....
Dec

I have the following data in the fact table:
Date Value
2003 Jan 5
2003 Feb 7
2003 Mar 6
2003 Apr
2003 May
.....

There is only data up till 2003 Mar. In AS i want on year level to show this
last available value, which is 6. I've tried a calculated value on year level:

Max({[Period].children},[Measures].[NumberValue])

But this gives me the highest value of the year which is 7. Any idea how i
can get the last available value in the year?

Thnx,

Stanley

Reply With Quote
  #3  
Old   
Stanley
 
Posts: n/a

Default RE: How to retrieve the last non empty cell in AS - 10-22-2004 , 09:07 AM



Hi,

I've tried this but i don't get any results, the value is empty. Also i've
noticed that you have't specified from which measure you want to see the
value of. So i did something like this:

{Tail(filter({Period.Children}, IsNull([Measures].[Number of Bikes])},
1)}.Item(0)

But without any results either.

Any other solution?

Thnx

Stanley


"Jamie Thomson" wrote:

Quote:
Does this work?

{Tail(filter({Period.Children}, IsNull(Period.CurrentMember)}, 1)}.Item(0)

Regards
Jamie Thomson
http://www.conchango.com


"Stanley" wrote:

Hi,

I have a a period dimension:
2003
Jan
Feb
Mar
.....
Dec

I have the following data in the fact table:
Date Value
2003 Jan 5
2003 Feb 7
2003 Mar 6
2003 Apr
2003 May
.....

There is only data up till 2003 Mar. In AS i want on year level to show this
last available value, which is 6. I've tried a calculated value on year level:

Max({[Period].children},[Measures].[NumberValue])

But this gives me the highest value of the year which is 7. Any idea how i
can get the last available value in the year?

Thnx,

Stanley

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.