<?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: How to calculate YTD that includes future data in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/803012#M15902</link>
    <description>&lt;P&gt;Here's how you can calculate a month and year counter based on a reporting date:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  Reporting_Month = intck('MONTH', Reporting_Date, today()); 
  Reporting_Year  = intck('YEAR', Reporting_Date, today());
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm assuming here that you can do this in "normal" SAS before you load into VA.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Mar 2022 02:08:38 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2022-03-21T02:08:38Z</dc:date>
    <item>
      <title>How to calculate YTD that includes future data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/802053#M15889</link>
      <description>&lt;P&gt;Hi VA experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a report to compare the YTD revenue of this year to the previous year. I was able to calculate the YTD revenue from the beginning of the year to the current date. However, there is some future revenue that was captured in the data therefore I want to include revenue from the beginning of the year to end of the current month.&amp;nbsp; I could manually select the last day of the month for this year and last year. I was wondering there's a better way to do that without any manual effort.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="YTD (beginning of the year - end of current month)" style="width: 566px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69454i93093FA5275D6B5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="YTD.PNG" alt="YTD (beginning of the year - end of current month)" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;YTD (beginning of the year - end of current month)&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thank you for any help you can provide!&lt;/P&gt;</description>
      <pubDate>Mon, 14 Mar 2022 20:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/802053#M15889</guid>
      <dc:creator>tweehh</dc:creator>
      <dc:date>2022-03-14T20:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate YTD that includes future data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/802088#M15890</link>
      <description>&lt;P&gt;One way to do this is to add month and year counters to your VA load table. Set it to 0 for the current month / year, -1 last month / year, -2 for the month / year before that and so on. This would be automatically created each time you update your VA load table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then a simple static filter to get current year would be: where year_counter = 0 and month_counter &amp;lt;= 0, and for last year: where year_counter = -1&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 00:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/802088#M15890</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-03-15T00:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate YTD that includes future data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/802375#M15896</link>
      <description>Thank you for your response! Can you provide more details on how to implement it in VA? Thanks!</description>
      <pubDate>Tue, 15 Mar 2022 23:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/802375#M15896</guid>
      <dc:creator>tweehh</dc:creator>
      <dc:date>2022-03-15T23:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate YTD that includes future data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/802775#M15899</link>
      <description>&lt;P&gt;I've made the best experiences with a report_date variable in the data prep step via code.&lt;/P&gt;
&lt;P&gt;You can use it easily in filters then.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure if this screenshot helps you out, but it shows well how the parallel period reacts to filters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;good luck&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69553i0923E08791A7E24D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic.png" alt="pic.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pic1.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/69554i220B0E1E47C0B319/image-size/large?v=v2&amp;amp;px=999" role="button" title="pic1.png" alt="pic1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 12:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/802775#M15899</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2022-03-18T12:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate YTD that includes future data</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/803012#M15902</link>
      <description>&lt;P&gt;Here's how you can calculate a month and year counter based on a reporting date:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  Reporting_Month = intck('MONTH', Reporting_Date, today()); 
  Reporting_Year  = intck('YEAR', Reporting_Date, today());
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm assuming here that you can do this in "normal" SAS before you load into VA.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 02:08:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-YTD-that-includes-future-data/m-p/803012#M15902</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-03-21T02:08:38Z</dc:date>
    </item>
  </channel>
</rss>

