<?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: difference of sales between last 12 weeks current year vs last year in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770658#M15338</link>
    <description>&lt;P&gt;hello Sam,&lt;BR /&gt;thank you for advice, yes, I am going to do that per quarter, to make my life easier. If the quarter is still running and I would like to compare the same periods, do you have to choose option to today and build a filter to limit the calculations to current month? One more quesiton: how to compare last wk this year to last wk prevoius year to have one single value in a crosstab?regards Karolina&lt;/P&gt;</description>
    <pubDate>Mon, 27 Sep 2021 15:41:59 GMT</pubDate>
    <dc:creator>touwen_k</dc:creator>
    <dc:date>2021-09-27T15:41:59Z</dc:date>
    <item>
      <title>difference of sales between last 12 weeks current year vs last year</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770505#M15336</link>
      <description>&lt;P&gt;dear community users,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to calculate a variation% of sales, so difference of (12 wks sales of current year - 12 wks previous year)/ 12wks previous year. How to do that in VA? The visualisation should be one single sum. I can work with hardcoded values if needed.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 15:12:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770505#M15336</guid>
      <dc:creator>touwen_k</dc:creator>
      <dc:date>2021-09-26T15:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: difference of sales between last 12 weeks current year vs last year</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770652#M15337</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the ParallelPeriod() operator to compare quarterly data.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/vacdc/v_003/vareportdata/p0dovqqp325peyn1dpijpxxmwj83.htm#p1dn6xullue9hkn131dkuudpz2br" target="_blank"&gt;https://documentation.sas.com/doc/en/vacdc/v_003/vareportdata/p0dovqqp325peyn1dpijpxxmwj83.htm#p1dn6xullue9hkn131dkuudpz2br&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Comparing the last 12 weeks versus the same 12 weeks from the previous year will be harder. You can perform calculations on dates by using the TreatAs() operator, so in theory you could create some very complex expressions to retrieve and compare the values. It would be MUCH easier to compare the quarterly data if that would be acceptable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 15:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770652#M15337</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-09-27T15:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: difference of sales between last 12 weeks current year vs last year</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770658#M15338</link>
      <description>&lt;P&gt;hello Sam,&lt;BR /&gt;thank you for advice, yes, I am going to do that per quarter, to make my life easier. If the quarter is still running and I would like to compare the same periods, do you have to choose option to today and build a filter to limit the calculations to current month? One more quesiton: how to compare last wk this year to last wk prevoius year to have one single value in a crosstab?regards Karolina&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 15:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770658#M15338</guid>
      <dc:creator>touwen_k</dc:creator>
      <dc:date>2021-09-27T15:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: difference of sales between last 12 weeks current year vs last year</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770660#M15339</link>
      <description>&lt;P&gt;You can select _ToDate_ as a parameter for ParallelPeriod. There are a lot of parameter fields you need to supply, so check the tooltip for each one to get an explanation of what it does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, I think you can use the quick calculation feature to do this. See &lt;STRONG&gt;Difference from previous parallel period&lt;/STRONG&gt; here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/vacdc/v_003/vareportdata/p1vsphor4qnevcn13p4bepmj5wwx.htm" target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/vacdc/v_003/vareportdata/p1vsphor4qnevcn13p4bepmj5wwx.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Comparing last week this year versus last week of last year is a little bit trickier, but you can do something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;RelativePeriod(_Sum_, 'Expenses'n, _ApplyAllFilters_, 'Date'n, _ByWeek_, -1, _Full_)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;-&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ParallelPeriod(_Sum_, 'Expenses'n, _ApplyAllFilters_, TreatAs(_Date_, (Treatas(_Number_, 'Date'n) - 7), _ByWeek_, _ByYear_, -1, _Full_)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I didn't have time to test this, but the basic idea should work. You are using TreatAs() to perform math on the date to get the previous week's date for ParallelPeriod.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Let us know if you have any trouble or further questions! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 27 Sep 2021 16:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/difference-of-sales-between-last-12-weeks-current-year-vs-last/m-p/770660#M15339</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-09-27T16:01:08Z</dc:date>
    </item>
  </channel>
</rss>

