- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 04-29-2011 05:25 AM
(1704 views)
This doesn't seem like the right forum for this question, but other MDX questions are being answered here, so I'll try...
There is a one sentence mention in the SAS MDX manual that you can use SAS functions in MDX in the format 'SAS!mdx(2,9,2003)' for example for the the mdx function, i.e. the function must have a prefix of SAS!
The manual is short on examples, so I'm wondering if someone can help with the syntax for filtering out the past 5 years based on today's date. The syntax I'm using is:
create set [Orion Star Customer Order Cube].[Last5Years] as
'FILTER(
[Time_Dimension].[Year_Qtr_Month].[All Year_Qtr_Month].Children ,
[Time_Dimension].[Year_Qtr_Month].currentmember.name>="'SAS!year(today())-5"
)
'
The currentmember name has values of 2006 2007 etc.
It doesn't seem to like the >="'SAS!year(today())-5"
Any help is most appreciated.
Mark
There is a one sentence mention in the SAS MDX manual that you can use SAS functions in MDX in the format 'SAS!mdx(2,9,2003)' for example for the the mdx function, i.e. the function must have a prefix of SAS!
The manual is short on examples, so I'm wondering if someone can help with the syntax for filtering out the past 5 years based on today's date. The syntax I'm using is:
create set [Orion Star Customer Order Cube].[Last5Years] as
'FILTER(
[Time_Dimension].[Year_Qtr_Month].[All Year_Qtr_Month].Children ,
[Time_Dimension].[Year_Qtr_Month].currentmember.name>="'SAS!year(today())-5"
)
'
The currentmember name has values of 2006 2007 etc.
It doesn't seem to like the >="'SAS!year(today())-5"
Any help is most appreciated.
Mark
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mark,
Have you tried SAS!year(SAS!today())-5 ?
You might also find the standard MDX functions LastPeriods and ClosingPeriod of use. Something like:
LastPeriods(5, ClosingPeriod([Time_Dimension].[Year]))
Cheers
Paul
http://platformadmin.com/
Have you tried SAS!year(SAS!today())-5 ?
You might also find the standard MDX functions LastPeriods and ClosingPeriod of use. Something like:
LastPeriods(5, ClosingPeriod([Time_Dimension].[Year]))
Cheers
Paul
http://platformadmin.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Paul,
The additional SAS! seems like an obvious thing to try... I overlooked that. I haven't got it working yet, but if I do I'll post the solution. I'd like to learn about using SAS functions in MDX It would help if there was more information / examples in the manual.
Yes I've considered using functions such as LastPeriods etc and at the time I found it not to be suitable. I've taken another look and I'm having more success this time. I think that I can get this particular issue resolved using pure MDX, however I'd still like to see how to use SAS functions in MDX.
Thanks for your input Paul.
Mark
The additional SAS! seems like an obvious thing to try... I overlooked that. I haven't got it working yet, but if I do I'll post the solution. I'd like to learn about using SAS functions in MDX It would help if there was more information / examples in the manual.
Yes I've considered using functions such as LastPeriods etc and at the time I found it not to be suitable. I've taken another look and I'm having more success this time. I think that I can get this particular issue resolved using pure MDX, however I'd still like to see how to use SAS functions in MDX.
Thanks for your input Paul.
Mark