<?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 How to calculate relative half period and show this percentage in key value in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983259#M18925</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have calculated relative half period and show this difference percentage in key value from previous half period.&lt;/P&gt;&lt;P&gt;since it is not directly half period calculation in sas.&lt;/P&gt;&lt;P&gt;let' suppose the variable is billed amount&lt;/P&gt;&lt;P&gt;Thanks in advance.&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;Uttam Kumar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Feb 2026 12:37:09 GMT</pubDate>
    <dc:creator>uttamkumar7361</dc:creator>
    <dc:date>2026-02-10T12:37:09Z</dc:date>
    <item>
      <title>How to calculate relative half period and show this percentage in key value</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983259#M18925</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have calculated relative half period and show this difference percentage in key value from previous half period.&lt;/P&gt;&lt;P&gt;since it is not directly half period calculation in sas.&lt;/P&gt;&lt;P&gt;let' suppose the variable is billed amount&lt;/P&gt;&lt;P&gt;Thanks in advance.&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;Uttam Kumar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2026 12:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983259#M18925</guid>
      <dc:creator>uttamkumar7361</dc:creator>
      <dc:date>2026-02-10T12:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative half period and show this percentage in key value</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983260#M18926</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;What period do you want to calculate half of? Month, Year, Quarter? I think that this should probably be possible but the expression might be a bit messy-looking.&lt;/P&gt;
&lt;P&gt;Sam&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2026 13:37:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983260#M18926</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2026-02-10T13:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative half period and show this percentage in key value</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983266#M18927</link>
      <description>I want to calculate on half yearly basis and show in percentage in key value while user select half yearly ie. H1 or H2 and after selection of year&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Feb 2026 14:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983266#M18927</guid>
      <dc:creator>uttamkumar7361</dc:creator>
      <dc:date>2026-02-10T14:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate relative half period and show this percentage in key value</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983454#M18933</link>
      <description>&lt;P&gt;I was able to get a half year calculation working:&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="Screenshot 2026-02-13 101139.png" style="width: 599px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/113168i0DCBD7105DD47DF5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2026-02-13 101139.png" alt="Screenshot 2026-02-13 101139.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The expression is messy as I feared:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;IF ('Quarter'n =1 OR 'Quarter'n = 3)
   RETURN (RelativePeriod(_Sum_, RCOST, IgnoreAllTimeFrameFilters, 'Date (1)'n, ByQuarter, 1, Full) + Period(_Sum_, RCOST, IgnoreAllTimeFrameFilters, 'Date (1)'n, ByQuarter)) / (RelativePeriod(_Sum_, RCOST, IgnoreAllTimeFrameFilters, 'Date (1)'n, ByQuarter, -2, Full) + RelativePeriod(_Sum_, RCOST, IgnoreAllTimeFrameFilters, 'Date (1)'n, ByQuarter, -1, Full))
ELSE (RelativePeriod(_Sum_, RCOST, IgnoreAllTimeFrameFilters, 'Date (1)'n, ByQuarter, -1, Full) + Period(_Sum_, RCOST, IgnoreAllTimeFrameFilters, 'Date (1)'n, ByQuarter)) / (RelativePeriod(_Sum_, RCOST, IgnoreAllTimeFrameFilters, 'Date (1)'n, ByQuarter, -3, Full) + RelativePeriod(_Sum_, RCOST, IgnoreAllTimeFrameFilters, 'Date (1)'n, ByQuarter, -2, Full))&lt;/PRE&gt;
&lt;P&gt;The basic idea:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For odd-numbered quarters, compare the current quarter (&lt;STRONG&gt;Period()&lt;/STRONG&gt;) and the one after it (&lt;STRONG&gt;RelativePeriod(1)&lt;/STRONG&gt;) to the preceding period (&lt;STRONG&gt;RelativePeriod(-1)&lt;/STRONG&gt;) and the one before that (&lt;STRONG&gt;RelativePeriod(-2)&lt;/STRONG&gt;).&lt;/P&gt;
&lt;P&gt;For even quarters,&amp;nbsp;compare the current quarter (&lt;STRONG&gt;Period()&lt;/STRONG&gt;) and the one before it (&lt;STRONG&gt;RelativePeriod(-1)&lt;/STRONG&gt;) to two periods ago (&lt;STRONG&gt;RelativePeriod(-2)&lt;/STRONG&gt;) and the one before that (&lt;STRONG&gt;RelativePeriod(-3)&lt;/STRONG&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A roadblock I hit was trying to calculate the quarter as part of this expression. Currently this is not supported, so I am pre-calculating the quarter using the Quarter() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure if this actually helps&amp;nbsp; you with your goal of showing this in a Key Value, however! I think that an expression with periodic functions will always be Missing in a key value object because it doesn't have enough context to calculate the aggregations.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 15:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/How-to-calculate-relative-half-period-and-show-this-percentage/m-p/983454#M18933</guid>
      <dc:creator>Sam_SAS</dc:creator>
      <dc:date>2026-02-13T15:25:25Z</dc:date>
    </item>
  </channel>
</rss>

