dbTalk Databases Forums  

PrevMember is if current member IsEmpty

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


Discuss PrevMember is if current member IsEmpty in the microsoft.public.sqlserver.olap forum.



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

Default PrevMember is if current member IsEmpty - 08-05-2004 , 11:01 AM






Hi all, I have a cube that shows products along the rows,
days across the columns,
and the product prices for the measurement.

The problem:
Even though a product doesn't sell on a particular day,
we still want the price
to show by using the last known price.

Can someone please show me an example of how to make the
price use the last known
price, i.e. the previous time member's price for the days
when it did not sell?


An example of my cube is below:


This is what I currently have:

Day1 Day2 Day3 Day4 Day5

Prod1 Price $5 $5 $7




This is what I want:

Day1 Day2 Day3 Day4 Day5

Prod1 Price $5 $5 $5 $5 $7


Day3 and Day4 uses Day2's price of $5 even though Prod1
did not sell on Day3 and Day4.


I really do appreciate any assistance.

Jason


Reply With Quote
  #2  
Old   
Harsh
 
Posts: n/a

Default Re: PrevMember is if current member IsEmpty - 08-06-2004 , 11:27 AM






Here is a "unique solution" to your problem. Try this on Foodmart.

- Create a "dummy measure". (Just anything will do) We will use this
as a place holder.

- Create a Calculated Cell

- Define the subcube with the [dummy measure] and the [Time] at Month
level.

- Put this MDX for calculation.

iif(IsNull([Measures].[Units Ordered]),(Tail(filter({lastperiods(7,
[Time].currentmember)}, Not IsEmpty([Measures].[Units Ordered])),
1).item(0).item(0), [Measures].[Units Ordered]), [Measures].[Units
Ordered])

Remember to handle the "aggregation". This would be a semiadditive
measure, so please be careful about that.

HTH

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.