Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Help to create calculated measure based on Effective Date

 
   Database Help (Home) -> OLAP RSS
Next:  DataArchitect 4.1 for SQL Server on LINUX/SOLARIS..  
Author Message
Mahesh

External


Since: Dec 16, 2008
Posts: 5



(Msg. 1) Posted: Tue Dec 16, 2008 12:17 pm
Post subject: Help to create calculated measure based on Effective Date
Archived from groups: microsoft>public>sqlserver>olap (more info?)

My fact table and dimension (simplified) looks like this:

Fact Table
Product ID, DateID, Price
P1, 01-Jan-2008, $10
P1, 01-Feb-2008, $15
P1, 15-Apr-2008 $17

Product Dimension
ProductID, Product Name

Effective
EffectiveDateID
DateDisplay

I have built a cube based on this. Now i need to create a calculated
measure called Effective Price which will give the price for a given
day. Fo example: it should be $10 for 05-Jan-2008, $15 for 15-Feb-2008
and $17 for 15-Apr-2008. Any help to create this calculated measure
will be very much appreciated.

I have used the aggregation of type 'Last Non-Empty Child' for Price
and it is giving the latest price when i choose all dates.

Thanks
Mahesh

 >> Stay informed about: Help to create calculated measure based on Effective Date 
Back to top
Login to vote
dpuri

External


Since: Nov 19, 2008
Posts: 3



(Msg. 2) Posted: Wed Dec 17, 2008 9:34 pm
Post subject: Re: Help to create calculated measure based on Effective Date [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Try someting like:

([Measures].[Price],
Tail(NonEmpty({Null
:[EffectiveDate].[EffectiveDateID].CurrentMember},
[Measures].[Price])).Item(0))


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

 >> Stay informed about: Help to create calculated measure based on Effective Date 
Back to top
Login to vote
Mahesh

External


Since: Dec 16, 2008
Posts: 5



(Msg. 3) Posted: Thu Dec 18, 2008 2:53 pm
Post subject: Re: Help to create calculated measure based on Effective Date [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks, Deepak. This looks like the perfect solution.

Mahesh

On Dec 17, 10:34 pm, dpuri wrote:
> Try someting like:
>
> ([Measures].[Price],
> Tail(NonEmpty({Null
> :[EffectiveDate].[EffectiveDateID].CurrentMember},
> [Measures].[Price])).Item(0))
>
> - Deepak
>
> Deepak Puri
> Microsoft MVP - SQL Server
>
> *** Sent via Developersdexhttp://www.developersdex.com***
 >> Stay informed about: Help to create calculated measure based on Effective Date 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Calculated measure based on a dimension - I have a dimension called servicer group with 2 levels ServicerGroup Servicer Here are some members in each group SerivcerGroup Not Assigned Outside Internal Servicer Agency 1 Agency 2 Agency 3 I create a calculated measure which work..

How can one create multiple measure groups based on the sa.. - I have a situation where I have a contract table with a start and closed date. I would like to have two measure groups for this table, New Contracts: links to the calendar based on the start date Closed Contracts: links to this table based on the..

Returning a value for a measure evaluated over a set in a .. - I'm having a lot of problems trying to create a calculated measure that returns the value of another measure over a specified time series. If I run a select to return the data there is no problem and the select statement I'm using looks like the..

Vanishing Calculated Measure - I had a calculated measure called "Return%". For testing purposes, I created another measure called "Return_%" with an underscore in between "Return" and "%". I deleted the original "Return%" calculated ...

Format String for Calculated Measure not working - Hello, If I set the format string on a real measure, it persists to the pivot table. However, If I set the format string to something like "currency", it is not being automatically formatted in the pivot table as currency. How can I get t...
   Database Help (Home) -> OLAP All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]