<?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 Find Percentage Difference in Data Query in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Find-Percentage-Difference-in-Data-Query/m-p/280652#M4690</link>
    <description>&lt;P&gt;Hi, I'm trying to find the percentage difference of counts from previous period (eg previous year/quarter/month). I'm currently using the aggregated measure way in report designer where the percentage difference is easily generated by SAS VA. However, this approach will result in the first period percentage column in the crosstab to be empty (since there isn't any previous period). So for instance, the first period on my crosstab is 2011, the percentage difference between 2010 &amp;amp; 2011 will not be shown (refer to image) since 2010 is not in the crosstab and I'm not planning to display 2010 on the crosstab. However, I do have data for 2010.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3810iEDD07E92EE1D3735/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="perc diff empty.png" title="perc diff empty.png" /&gt;&lt;/P&gt;&lt;P&gt;The SQL code for the aggregated measure i'm currently using is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;( RelativePeriod(_Sum_, 'NUM_CNT'n, 'DTE_CANCEL'n, _Inferred_, 0, _Full_, {Date}) - RelativePeriod(_Sum_, 'NUM_CNT'n, 'DTE_CANCEL'n, _Inferred_, -1, _Full_, {Date}) ) / Abs(RelativePeriod(_Sum_, 'NUM_CNT'n, 'DTE_CANCEL'n, _Inferred_, -1, _Full_, {Date}))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence, I'm thinking if it's possible to make the percentage difference statis by defining it in the data query whereby I have a list of percentage difference generated for different period and just place it in the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I'm not sure if this is possible or how to go about doing it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm open to new ideas and suggestions. Any help will be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2016 05:34:36 GMT</pubDate>
    <dc:creator>qiaojinggg</dc:creator>
    <dc:date>2016-06-28T05:34:36Z</dc:date>
    <item>
      <title>Find Percentage Difference in Data Query</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Find-Percentage-Difference-in-Data-Query/m-p/280652#M4690</link>
      <description>&lt;P&gt;Hi, I'm trying to find the percentage difference of counts from previous period (eg previous year/quarter/month). I'm currently using the aggregated measure way in report designer where the percentage difference is easily generated by SAS VA. However, this approach will result in the first period percentage column in the crosstab to be empty (since there isn't any previous period). So for instance, the first period on my crosstab is 2011, the percentage difference between 2010 &amp;amp; 2011 will not be shown (refer to image) since 2010 is not in the crosstab and I'm not planning to display 2010 on the crosstab. However, I do have data for 2010.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3810iEDD07E92EE1D3735/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="perc diff empty.png" title="perc diff empty.png" /&gt;&lt;/P&gt;&lt;P&gt;The SQL code for the aggregated measure i'm currently using is&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;( RelativePeriod(_Sum_, 'NUM_CNT'n, 'DTE_CANCEL'n, _Inferred_, 0, _Full_, {Date}) - RelativePeriod(_Sum_, 'NUM_CNT'n, 'DTE_CANCEL'n, _Inferred_, -1, _Full_, {Date}) ) / Abs(RelativePeriod(_Sum_, 'NUM_CNT'n, 'DTE_CANCEL'n, _Inferred_, -1, _Full_, {Date}))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hence, I'm thinking if it's possible to make the percentage difference statis by defining it in the data query whereby I have a list of percentage difference generated for different period and just place it in the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I'm not sure if this is possible or how to go about doing it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm open to new ideas and suggestions. Any help will be greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 05:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Find-Percentage-Difference-in-Data-Query/m-p/280652#M4690</guid>
      <dc:creator>qiaojinggg</dc:creator>
      <dc:date>2016-06-28T05:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Find Percentage Difference in Data Query</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Find-Percentage-Difference-in-Data-Query/m-p/283756#M4779</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;qiaojinggg&lt;/SPAN&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Before I can possibly solve your questions, I need some clarification first.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;For the 1st part of your question ... is this what you are after?&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="color: rgb(31, 73, 125);"&gt;&lt;FONT face="Calibri" size="3"&gt;Wherever your Aggregated Measure formula results yield in . (aka dot, aka missing) …&amp;nbsp;are you looking to&amp;nbsp;hide the column(s)?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="color: rgb(31, 73, 125);"&gt;&lt;FONT face="Calibri" size="3"&gt;Meaning, are you&amp;nbsp;just looking to get rid of the “Difference (YR)” 2011 column since it’s empty? Otherwise, the percentage difference calculation seems to work for you, is that correct?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="color: rgb(31, 73, 125);"&gt;&lt;FONT face="Calibri" size="3"&gt;For the 2nd part of your question ... are you asking if SAS Visual Data Builder would be better for your scenario vs. SAS Visual Analytics Designer?&amp;nbsp; If so, I'll need clarification for the 1st part of your question (see above), before I can attempt this one as well.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="color: rgb(31, 73, 125);"&gt;&lt;FONT face="Calibri" size="3"&gt;Sincerely,&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN style="color: rgb(31, 73, 125);"&gt;&lt;FONT face="Calibri" size="3"&gt;Ted Stolarczyk, SAS Customer Loyalty team&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 13:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Find-Percentage-Difference-in-Data-Query/m-p/283756#M4779</guid>
      <dc:creator>TedStolarczyk</dc:creator>
      <dc:date>2016-07-12T13:10:05Z</dc:date>
    </item>
  </channel>
</rss>

