<?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: Last year same month (MTD) in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/742671#M14940</link>
    <description>Great! Thanks for sharing your solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 20 May 2021 14:53:24 GMT</pubDate>
    <dc:creator>Sam_SAS</dc:creator>
    <dc:date>2021-05-20T14:53:24Z</dc:date>
    <item>
      <title>Last year same month (MTD)</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/741114#M14919</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to calculate the month to date period for the same period last year.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eg. If today is 13/05/2021 (Current Month to Date) how do I calculate what sales was for 1/05/2020 to 13/05/2020?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 13:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/741114#M14919</guid>
      <dc:creator>Melissak</dc:creator>
      <dc:date>2021-05-13T13:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Last year same month (MTD)</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/741119#M14921</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would use the &lt;A href="https://go.documentation.sas.com/doc/en/vacdc/v_007/vareportdata/p0dovqqp325peyn1dpijpxxmwj83.htm#p1dn6xullue9hkn131dkuudpz2br" target="_self"&gt;ParallelPeriod operator&lt;/A&gt; in a calculated item.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example that should calculate the month-to-date value for the previous year:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;ParallelPeriod(_Sum_, 'Expenses'n, _ApplyAllFilters_, 'Date'n, _ByMonth_, _ByYear_, -1, _ToDate_)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The last parameter above specifies the "to date" part.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The UI for the periodic operators in the graphical expression editor is a bit confusing, so refer to the doc and the tooltips.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know how it goes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Sam&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 14:07:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/741119#M14921</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-05-13T14:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Last year same month (MTD)</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/741375#M14925</link>
      <description>Hi&lt;BR /&gt;I tried the above but it does the same calculation for every year in the data.&lt;BR /&gt;I want it to only return that value for the one month. (Last year, this month)</description>
      <pubDate>Fri, 14 May 2021 10:22:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/741375#M14925</guid>
      <dc:creator>Melissak</dc:creator>
      <dc:date>2021-05-14T10:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Last year same month (MTD)</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/741535#M14926</link>
      <description>&lt;P&gt;Getting only a specific month is actually a bit trickier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The easiest way might be to precalculate the value in your source table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am making some inquiries about a way to do it within VA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Fri, 14 May 2021 19:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/741535#M14926</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-05-14T19:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Last year same month (MTD)</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/742642#M14938</link>
      <description>&lt;P&gt;I managed to do this with the calculated item below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF ( ( Month('DATE X'n) = Month(DatePart(Now())) ) AND (&lt;BR /&gt;Year('DATE X'n) = Year(DatePart(Now()))-1 ))&lt;BR /&gt;DayOfMonth('DATE X'n) &amp;lt;= DayOfMonth(DatePart(Now())) ) )&lt;BR /&gt;RETURN 'VAUE X'n&lt;BR /&gt;ELSE 0&lt;/P&gt;</description>
      <pubDate>Thu, 20 May 2021 12:54:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/742642#M14938</guid>
      <dc:creator>Melissak</dc:creator>
      <dc:date>2021-05-20T12:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: Last year same month (MTD)</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/742671#M14940</link>
      <description>Great! Thanks for sharing your solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 20 May 2021 14:53:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Last-year-same-month-MTD/m-p/742671#M14940</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2021-05-20T14:53:24Z</dc:date>
    </item>
  </channel>
</rss>

