<?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 Calculated Metric for last two months in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568238#M12643</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am really don't how to achieve this or really this is possible in SAS VA 7.3. After watching SAS VA 8.2 I really don't like 7.3 because of it limitations. Anyways quick help or workaround in this will be of great help.&lt;/P&gt;
&lt;P&gt;In Metric 4 (M4) It is the sum of M1, M2 and M3 till the 3rd last month of the selected till date which simple but things gets messy for calculation of last two months. To calculate M4 for las two months it should take the average of M5 last 3rd and 4th month and than add M1+M2+M3. I am stuck on average part and how to show different calculations in same metric. This has been achieved in qlikview but unfortunately I don't have the calculation logic.&lt;/P&gt;
&lt;TABLE width="892"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="131"&gt;Service Month&lt;/TD&gt;
&lt;TD width="79"&gt;3/1/2019&lt;/TD&gt;
&lt;TD width="79"&gt;4/1/2019&lt;/TD&gt;
&lt;TD width="79"&gt;5/1/2019&lt;/TD&gt;
&lt;TD width="79"&gt;6/1/2019&lt;/TD&gt;
&lt;TD width="207"&gt;7/1/2019&lt;/TD&gt;
&lt;TD width="238"&gt;8/1/2019&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;M1&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&g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nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know it is little messy thing but any help on this will be highly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Anurag&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Jun 2019 20:31:05 GMT</pubDate>
    <dc:creator>anuragraishines</dc:creator>
    <dc:date>2019-06-23T20:31:05Z</dc:date>
    <item>
      <title>Calculated Metric for last two months</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568238#M12643</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am really don't how to achieve this or really this is possible in SAS VA 7.3. After watching SAS VA 8.2 I really don't like 7.3 because of it limitations. Anyways quick help or workaround in this will be of great help.&lt;/P&gt;
&lt;P&gt;In Metric 4 (M4) It is the sum of M1, M2 and M3 till the 3rd last month of the selected till date which simple but things gets messy for calculation of last two months. To calculate M4 for las two months it should take the average of M5 last 3rd and 4th month and than add M1+M2+M3. I am stuck on average part and how to show different calculations in same metric. This has been achieved in qlikview but unfortunately I don't have the calculation logic.&lt;/P&gt;
&lt;TABLE width="892"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="131"&gt;Service Month&lt;/TD&gt;
&lt;TD width="79"&gt;3/1/2019&lt;/TD&gt;
&lt;TD width="79"&gt;4/1/2019&lt;/TD&gt;
&lt;TD width="79"&gt;5/1/2019&lt;/TD&gt;
&lt;TD width="79"&gt;6/1/2019&lt;/TD&gt;
&lt;TD width="207"&gt;7/1/2019&lt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t;
&lt;TD&gt;2.90&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD colspan="2"&gt;AVERAGE&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know it is little messy thing but any help on this will be highly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Anurag&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jun 2019 20:31:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568238#M12643</guid>
      <dc:creator>anuragraishines</dc:creator>
      <dc:date>2019-06-23T20:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Metric for last two months</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568312#M12646</link>
      <description>&lt;P&gt;How is your source data structured? If you start with one row of data per month, the easiest way is to add a month index variable which you set to 0 for the current month, 1 for the last month, 2 for the month before that and so on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then to get the sum or average of the last three months, create an aggregate measure in the VA report designer, and filter on the month index &amp;lt;= 2.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 07:43:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568312#M12646</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-06-24T07:43:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Metric for last two months</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568792#M12651</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have never used index functionality with SAS VA. A little more insight will be helpful.&lt;/P&gt;
&lt;P&gt;I have multiple rows for the same period and data has to aggregate dynamically to the dimension used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am able to create both the metric but how to show them in single metric. The real challenge is to show two different metric calculation in single row.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Anurag&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 14:26:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568792#M12651</guid>
      <dc:creator>anuragraishines</dc:creator>
      <dc:date>2019-06-25T14:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Metric for last two months</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568924#M12652</link>
      <description>&lt;P&gt;You can derive a month counter this way, assuming that the latest reporting date is the last month and is the last day of each month (eg 31 May 2019). Note this logic requires a SAS DATA step and should be part of your data preparation before loading into LASR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  * Derive reporting month counter, latest month = 0, previous month = 1 and so on.;
  Reporting_Month = intck('MONTH', Reporting_Date, "&amp;amp;today"d); &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 20:52:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/Calculated-Metric-for-last-two-months/m-p/568924#M12652</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-06-25T20:52:59Z</dc:date>
    </item>
  </channel>
</rss>

