<?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: Creating a Year-to-go indicator on a calculated field in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/672810#M14054</link>
    <description>Just to clarify, the equation I'm trying to make is:&lt;BR /&gt;&lt;BR /&gt;(Year Revenue Goal 2020 - YTD Revenue 2020)/(Months left on 2020)&lt;BR /&gt;&lt;BR /&gt;This would be the same for the coupons</description>
    <pubDate>Tue, 28 Jul 2020 13:03:33 GMT</pubDate>
    <dc:creator>Renan_Crepaldi</dc:creator>
    <dc:date>2020-07-28T13:03:33Z</dc:date>
    <item>
      <title>Creating a Year-to-go indicator on a calculated field</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/672803#M14053</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm kinda new to the SAS VA and I'm not being able to create a specific calculated field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea is to calculate the average revenue/coupons we'll have to make on the rest of the year to complete our year goal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My data is on the store level, so I'll have to aggregate it to make these as big numbers. I've attached a sample of the table I'm using.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The difficult part is to calculate the amount of months left in the year to use it as the&amp;nbsp;denominator. Using the revenue as example, the formula I thought was something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Sum [_ForAll_] ((
IF ( Month('anoMesData'n) &amp;lt;= ( Month(DatePart(Now())) - 1 ) )
RETURN 'revenueGoal2020'
ELSE . )) -&lt;BR /&gt;Sum [_ForAll_] ((
IF ( Month('anoMesData'n) &amp;lt;= ( Month(DatePart(Now())) - 1 ) )
RETURN 'revenue2020'
ELSE . ))/&lt;BR /&gt;202012 - Month(DatePart(Now()))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Is this the best way to make this calculation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 12:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/672803#M14053</guid>
      <dc:creator>Renan_Crepaldi</dc:creator>
      <dc:date>2020-07-28T12:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Year-to-go indicator on a calculated field</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/672810#M14054</link>
      <description>Just to clarify, the equation I'm trying to make is:&lt;BR /&gt;&lt;BR /&gt;(Year Revenue Goal 2020 - YTD Revenue 2020)/(Months left on 2020)&lt;BR /&gt;&lt;BR /&gt;This would be the same for the coupons</description>
      <pubDate>Tue, 28 Jul 2020 13:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/672810#M14054</guid>
      <dc:creator>Renan_Crepaldi</dc:creator>
      <dc:date>2020-07-28T13:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Year-to-go indicator on a calculated field</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/672957#M14055</link>
      <description>&lt;P&gt;Just updating:&lt;/P&gt;
&lt;P&gt;I was able to put the logic on a formula, but it's giving an error because the denominator is not aggregated.&lt;/P&gt;
&lt;P&gt;The formula I've programmed is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;( Sum [_ForAll_] ('revenueGoal2020'n) / Sum [_ForAll_] ((
IF ( Month('DATE'n) &amp;lt;= ( Month(DatePart(Now())) - 1 ) )
RETURN 'revenue2020'n
ELSE . )) ) / ( 12 - ( Month(DatePart(Now())) - 1 ) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Am I doing something wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 19:38:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/672957#M14055</guid>
      <dc:creator>Renan_Crepaldi</dc:creator>
      <dc:date>2020-07-28T19:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Year-to-go indicator on a calculated field</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/673231#M14059</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, a person from my area was able to help me on this problem. I only needed to put a function to aggregate the data of the denominator.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The formula that worked stayed like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;( Sum [_ForAll_] ('revenueGoal2020'n) - Sum [_ForAll_] ((
IF ( Month('MONTH_YEAR'n) &amp;lt;= ( Month(DatePart(Now())) - 1 ) )
RETURN 'revenue2020'n
ELSE . )) ) / Max [_ForAll_] (( 12 - ( Month(DatePart(Now())) -
1 ) ))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jul 2020 17:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Creating-a-Year-to-go-indicator-on-a-calculated-field/m-p/673231#M14059</guid>
      <dc:creator>Renan_Crepaldi</dc:creator>
      <dc:date>2020-07-29T17:37:57Z</dc:date>
    </item>
  </channel>
</rss>

