dbTalk Databases Forums  

Fiscal YTD calc member, How?

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


Discuss Fiscal YTD calc member, How? in the microsoft.public.sqlserver.olap forum.



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

Default Fiscal YTD calc member, How? - 12-12-2003 , 12:39 PM






Hi,

I am trying to create a calculated member field which
calculates the Fiscal YTD Total for the current year. Can
someone help me with how the formula should look for a
member like this?

I have a dimension called Period, which has one level
called Gltransperiod - which is made up of periods (our
fiscal year starts in April). The periods look like:

2004007 - October 2003
2004008 - November 2003
2004009 - December 2003
and so on...

This dimension is related to the gltransperiod field in
the fact table. The measure is Glusdbal.

Thank you very much!

Trevor

Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Fiscal YTD calc member, How? - 12-13-2003 , 12:33 AM






Hi Trevor,

Assuming that you just have one measure:
Glusdbal, which aggregates by summing,
then here is how a calculated measure,
FYTDusdbal, could be created in MDX:

Quote:
With Member [Measures].[FYTDusdbal] as
'Sum(LastPeriods(StrToValue(Right(
[Period].CurrentMember.Name,2)),
[Period].CurrentMember),
[Measures].[Glusdbal])'
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Reply With Quote
  #3  
Old   
Trevor B
 
Posts: n/a

Default Re: Fiscal YTD calc member, How? - 12-15-2003 , 01:43 PM



Thank you Deepak!

It works!


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

Assuming that you just have one measure:
Glusdbal, which aggregates by summing,
then here is how a calculated measure,
FYTDusdbal, could be created in MDX:


With Member [Measures].[FYTDusdbal] as
'Sum(LastPeriods(StrToValue(Right(
[Period].CurrentMember.Name,2)),
[Period].CurrentMember),
[Measures].[Glusdbal])'



- Deepak

*** Sent via Developersdex http://www.developersdex.com
***
Don't just participate in USENET...get rewarded for it!
.


Reply With Quote
  #4  
Old   
Trevor B
 
Posts: n/a

Default Re: Fiscal YTD calc member, How? - 12-16-2003 , 02:55 PM



Deepak,

One problem...when I add the new calculated field to my
pivot table in Excel 2000, it crashes Excel. It works fine
in the cube browser in Analysis Services though, any ideas?
It does give an ERR when the All Period level is
chosen...maybe restricting this with an Iif statement?

Unsure,
Trevor


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

Assuming that you just have one measure:
Glusdbal, which aggregates by summing,
then here is how a calculated measure,
FYTDusdbal, could be created in MDX:


With Member [Measures].[FYTDusdbal] as
'Sum(LastPeriods(StrToValue(Right(
[Period].CurrentMember.Name,2)),
[Period].CurrentMember),
[Measures].[Glusdbal])'



- Deepak

*** Sent via Developersdex http://www.developersdex.com
***
Don't just participate in USENET...get rewarded for it!
.


Reply With Quote
  #5  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Fiscal YTD calc member, How? - 12-16-2003 , 03:24 PM



Trevor,

You're right, conditional logic is required to make the formula work at
the 'All' level - don't know if that's causing Excel to crash. You can
try something like:

Quote:
With Member [Measures].[FYTDusdbal] as
'iif([Period].CurrentMember.Level is
[Period].[Gltransperiod],
Sum(LastPeriods(StrToValue(Right(
[Period].CurrentMember.Name,2)),
[Period].CurrentMember),
[Measures].[Glusdbal]),
[Measures].[Glusdbal])'
Quote:

- Deepak

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


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.