<?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 Percent difference from &amp;quot;fixed&amp;quot; previous period in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355509#M7088</link>
    <description>&lt;P&gt;HI -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to SAS VA and this community and would like to see if anyone here&amp;nbsp;can help me to solve a problem I have when designing a report. I want to create a graph showing percent difference from a &lt;STRONG&gt;fixed&lt;/STRONG&gt; previous period (the first date&amp;nbsp;in my data).&amp;nbsp;I do not really understand how I can achieve this from the optional settings in the aggregated measure editor. Does anyone have any kind of solution for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Mats&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S It doesnt have to be solved within the editor - any solution woud be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 May 2017 08:26:55 GMT</pubDate>
    <dc:creator>Kroken</dc:creator>
    <dc:date>2017-05-03T08:26:55Z</dc:date>
    <item>
      <title>Percent difference from "fixed" previous period</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355509#M7088</link>
      <description>&lt;P&gt;HI -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to SAS VA and this community and would like to see if anyone here&amp;nbsp;can help me to solve a problem I have when designing a report. I want to create a graph showing percent difference from a &lt;STRONG&gt;fixed&lt;/STRONG&gt; previous period (the first date&amp;nbsp;in my data).&amp;nbsp;I do not really understand how I can achieve this from the optional settings in the aggregated measure editor. Does anyone have any kind of solution for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Mats&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;P.S It doesnt have to be solved within the editor - any solution woud be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 08:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355509#M7088</guid>
      <dc:creator>Kroken</dc:creator>
      <dc:date>2017-05-03T08:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Percent difference from "fixed" previous period</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355518#M7089</link>
      <description>&lt;P&gt;Well, I don't use VA so my answer here is going to be general SAS code. &amp;nbsp;What I would do, and its per the models in my field, is to extract the baseline value, then merge that back to the original data. &amp;nbsp;So (and you have not posted and test data in the form of a datastep so this is just example):&lt;/P&gt;
&lt;P&gt;Some examplpe data:&lt;/P&gt;
&lt;P&gt;Id &amp;nbsp; &amp;nbsp; Period &amp;nbsp; &amp;nbsp; &amp;nbsp;Result&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 123&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 345&lt;/P&gt;
&lt;P&gt;1 &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;456&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data base (rename=(result=base));
  set have;&lt;BR /&gt;  where period=1;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;  merge have base;&lt;BR /&gt;  by id;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;Now in this case, all records in the original dataset have a column base from the fixed period, and you can calculate across.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 09:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355518#M7089</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-03T09:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Percent difference from "fixed" previous period</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355559#M7090</link>
      <description>&lt;P&gt;If the reference date can be hardcoded, then you could use the PeriodWithDate operator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, you might use an expression like this to compare the values of Sales for each month to the value from JAN2015:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Period(_Sum_, 'Sales'n, 'Date'n, _ByMonth_) - PeriodWithDate(_Sum_, 'Sales'n, 'Date'n, _ByMonth_, '01JAN2015'd)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Documentation for Period() and PeriodWithDate() can be found here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/vaug/68648/HTML/default/viewer.htm#n1lxnqfip132can1hdzuerib7i76.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/vaug/68648/HTML/default/viewer.htm#n1lxnqfip132can1hdzuerib7i76.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the first date in the data set needs to be determined dynamically, I don't think that can be done easily in the expression editor. You will need to use SAS code in your data query to evaluate it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 12:42:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355559#M7090</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2017-05-03T12:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Percent difference from "fixed" previous period</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355635#M7094</link>
      <description>&lt;P&gt;Thanks - both of you!&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 14:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Percent-difference-from-quot-fixed-quot-previous-period/m-p/355635#M7094</guid>
      <dc:creator>Kroken</dc:creator>
      <dc:date>2017-05-03T14:57:35Z</dc:date>
    </item>
  </channel>
</rss>

