<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MDX: Using a SAS function in SAS Web Report Studio</title>
    <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-Using-a-SAS-function/m-p/59956#M1155</link>
    <description>Hi Mark,&lt;BR /&gt;
&lt;BR /&gt;
Have you tried SAS!year(SAS!today())-5 ?&lt;BR /&gt;
&lt;BR /&gt;
You might also find the standard MDX functions LastPeriods and ClosingPeriod of use.  Something like:&lt;BR /&gt;
&lt;BR /&gt;
LastPeriods(5, ClosingPeriod([Time_Dimension].[Year]))&lt;BR /&gt;
&lt;BR /&gt;
Cheers&lt;BR /&gt;
Paul&lt;BR /&gt;
&lt;A href="http://platformadmin.com/" target="_blank"&gt;http://platformadmin.com/&lt;/A&gt;</description>
    <pubDate>Fri, 29 Apr 2011 11:38:40 GMT</pubDate>
    <dc:creator>PaulHomes</dc:creator>
    <dc:date>2011-04-29T11:38:40Z</dc:date>
    <item>
      <title>MDX: Using a SAS function</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-Using-a-SAS-function/m-p/59955#M1154</link>
      <description>This doesn't seem like the right forum for this question, but other MDX questions are being answered here, so I'll try...&lt;BR /&gt;
&lt;BR /&gt;
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!&lt;BR /&gt;
&lt;BR /&gt;
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:&lt;BR /&gt;
&lt;BR /&gt;
create set [Orion Star Customer Order Cube].[Last5Years] as &lt;BR /&gt;
&lt;BR /&gt;
'FILTER(&lt;BR /&gt;
[Time_Dimension].[Year_Qtr_Month].[All Year_Qtr_Month].Children , &lt;BR /&gt;
[Time_Dimension].[Year_Qtr_Month].currentmember.name&amp;gt;="'SAS!year(today())-5"&lt;BR /&gt;
)&lt;BR /&gt;
'&lt;BR /&gt;
&lt;BR /&gt;
The currentmember name has values of 2006 2007 etc. &lt;BR /&gt;
&lt;BR /&gt;
It doesn't seem to like the &amp;gt;="'SAS!year(today())-5"&lt;BR /&gt;
&lt;BR /&gt;
Any help is most appreciated.&lt;BR /&gt;
&lt;BR /&gt;
Mark</description>
      <pubDate>Fri, 29 Apr 2011 09:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-Using-a-SAS-function/m-p/59955#M1154</guid>
      <dc:creator>MarkBodt_NZ</dc:creator>
      <dc:date>2011-04-29T09:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: MDX: Using a SAS function</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-Using-a-SAS-function/m-p/59956#M1155</link>
      <description>Hi Mark,&lt;BR /&gt;
&lt;BR /&gt;
Have you tried SAS!year(SAS!today())-5 ?&lt;BR /&gt;
&lt;BR /&gt;
You might also find the standard MDX functions LastPeriods and ClosingPeriod of use.  Something like:&lt;BR /&gt;
&lt;BR /&gt;
LastPeriods(5, ClosingPeriod([Time_Dimension].[Year]))&lt;BR /&gt;
&lt;BR /&gt;
Cheers&lt;BR /&gt;
Paul&lt;BR /&gt;
&lt;A href="http://platformadmin.com/" target="_blank"&gt;http://platformadmin.com/&lt;/A&gt;</description>
      <pubDate>Fri, 29 Apr 2011 11:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-Using-a-SAS-function/m-p/59956#M1155</guid>
      <dc:creator>PaulHomes</dc:creator>
      <dc:date>2011-04-29T11:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: MDX: Using a SAS function</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-Using-a-SAS-function/m-p/59957#M1156</link>
      <description>Thanks Paul,&lt;BR /&gt;
&lt;BR /&gt;
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.&lt;BR /&gt;
&lt;BR /&gt;
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. &lt;BR /&gt;
&lt;BR /&gt;
Thanks for your input Paul.&lt;BR /&gt;
&lt;BR /&gt;
Mark</description>
      <pubDate>Fri, 29 Apr 2011 22:27:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-Using-a-SAS-function/m-p/59957#M1156</guid>
      <dc:creator>MarkBodt_NZ</dc:creator>
      <dc:date>2011-04-29T22:27:18Z</dc:date>
    </item>
  </channel>
</rss>

