<?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: Get data from previous period based on from and to date in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/783319#M15667</link>
    <description>&lt;P&gt;Thank you Sam for your efforts &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I guess in the end I create a custom data source.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 Dec 2021 06:35:44 GMT</pubDate>
    <dc:creator>Dominik4</dc:creator>
    <dc:date>2021-12-01T06:35:44Z</dc:date>
    <item>
      <title>Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/781681#M15649</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a newbie in VA and I would like to get a summed up value from a previous period (depending on user from and to filter).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;User-Filter with from date 01.05.2021 and to date 31.10.2021&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column 1: Sum(MyNumericColumn) --&amp;gt; data between&amp;nbsp;01.05.2021 and 31.10.2021&amp;nbsp;&lt;/P&gt;&lt;P&gt;Column 2: Sum(MyNumericColumn)&amp;nbsp;--&amp;gt; data between&amp;nbsp;01.05.2020 and 31.10.2020&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I already tried to create an calculated column with aggregated (periodic) element as resulttype aggregated measure without success. I get no results and besides that it looks like I can just refer to one single date and not a from to period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is something I descriped possible in VA?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 08:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/781681#M15649</guid>
      <dc:creator>Dominik4</dc:creator>
      <dc:date>2021-11-22T08:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/781726#M15651</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to display those two values, there is no need to create a calculated item.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="slider.gif" style="width: 585px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66015iCF7409D4785AFA29/image-size/large?v=v2&amp;amp;px=999" role="button" title="slider.gif" alt="slider.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here, the slider control is configured to filter the table through the Actions tab.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'm not sure if you want to do something more complex. If you want to display these filtered, aggregated values along with unfiltered values or detail (unaggregated) values in the same object, then calculated expressions would be needed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know if that helps,&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 14:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/781726#M15651</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-11-22T14:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/781860#M15652</link>
      <description>&lt;P&gt;Hello Sam,&lt;/P&gt;&lt;P&gt;thank you for you replay.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to aggregate filtered and unfiltered rows (in two different columns). I try to explain it with your example screenshot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Assumed the user set the filter to&lt;SPAN&gt;&amp;nbsp;01.05.&lt;STRONG&gt;2021&lt;/STRONG&gt;&amp;nbsp;to 31.10.&lt;STRONG&gt;2021&lt;/STRONG&gt; I would like to have the following columns:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Product Line, ProductSaleFilterYear, ProductSaleYearBefore&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The column&amp;nbsp;ProductSaleYearBefore should contain data for each Product Line from&amp;nbsp;01.05.&lt;STRONG&gt;2020&lt;/STRONG&gt; to 31.10.&lt;STRONG&gt;2020&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you say I guess I need a calculated expression but until now I was not successfull. Can you help me choosing the right expression and setting the correct parameters?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 05:51:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/781860#M15652</guid>
      <dc:creator>Dominik4</dc:creator>
      <dc:date>2021-11-23T05:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/781969#M15655</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the additional details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure the exact behavior you are asking for is possible. It would be difficult, at any rate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something relatively easy to do is to calculate last year's value and display it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="slider2.gif" style="width: 566px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66042i922AB134A27F5C26/image-size/large?v=v2&amp;amp;px=999" role="button" title="slider2.gif" alt="slider2.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here, the slider is still just a filter, but we show last year's value for each month.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could switch the month to quarter if that would be closer:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="slider3.gif" style="width: 582px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66043i78AB3830508D7C13/image-size/large?v=v2&amp;amp;px=999" role="button" title="slider3.gif" alt="slider3.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this example I am using the ParallelPeriod operator to get the previous year's values:&lt;/P&gt;
&lt;PRE&gt;ParallelPeriod(_Sum_, 'Product Sale'n,
_IgnoreAllTimeFrameFilters_, 'Transaction Month'n, _Inferred_,
_Inferred_, -1, _Full_, {Date})&lt;/PRE&gt;
&lt;P&gt;If I change the slider to select a single value, and I move the Quarter column to the Hidden role in the table, I get this, which might be a little closer yet to what you are asking:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="slider4.gif" style="width: 596px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66044iA0F66957169B0411/image-size/large?v=v2&amp;amp;px=999" role="button" title="slider4.gif" alt="slider4.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Possibly someone else will have a suggestion to match your requirement more closely.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 15:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/781969#M15655</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-11-23T15:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/782168#M15656</link>
      <description>&lt;P&gt;Hello Sam,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for that suggestion. I will test it to learn and I talk to my collueges to ask if this helps. Problem is that we have defined seasons (for example&amp;nbsp;&lt;SPAN&gt;01.05.2021 and 31.10.2021 ) so quarters are not close enough.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In worst case I could create another data source and using VA just for displaying.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 09:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/782168#M15656</guid>
      <dc:creator>Dominik4</dc:creator>
      <dc:date>2021-11-24T09:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/782229#M15657</link>
      <description>&lt;P&gt;If the seasons are predefined, you could assign the date ranges as a custom category and use the values of that as a filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am out of the office for the Thanksgiving holiday but I will try to experiment with this later if you'd like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Wed, 24 Nov 2021 14:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/782229#M15657</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-11-24T14:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/782424#M15661</link>
      <description>&lt;P&gt;Thank you for you offer. I think it is important to have a break from work. You can enjoy Thanksgiving holiday &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Currently the users do 2 reports (one of each date range) and put it in excel together. I have the feeling that they do this since years so no need to hurry I guess. Nevertheless I try to improve the work process.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How could a custom category help? In this case I would have two filters (custom category and the normal period filter). Both can not apply at the same time so I need some kind of "or condition" if possible. But then I have an similar problem as before?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Nov 2021 12:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/782424#M15661</guid>
      <dc:creator>Dominik4</dc:creator>
      <dc:date>2021-11-25T12:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/782920#M15663</link>
      <description>&lt;P&gt;Sorry, when I give this further thought I don't think a custom category is helpful for what you need. It works fine to select the time periods but cannot really be used to calculate the previous year's values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's possible that some very complex expression might work, but it would not be straightforward.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 14:37:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/782920#M15663</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-11-29T14:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/783319#M15667</link>
      <description>&lt;P&gt;Thank you Sam for your efforts &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I guess in the end I create a custom data source.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 06:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/783319#M15667</guid>
      <dc:creator>Dominik4</dc:creator>
      <dc:date>2021-12-01T06:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Get data from previous period based on from and to date</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/783390#M15668</link>
      <description>&lt;P&gt;Modifying your data source is often the best option, if it is possible for you. SAS DATA steps and SQL syntax are more powerful than the expression language in VA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope it works out for you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 14:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Get-data-from-previous-period-based-on-from-and-to-date/m-p/783390#M15668</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-12-01T14:41:46Z</dc:date>
    </item>
  </channel>
</rss>

