<?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 sas va calculate rate between first N revenue and total revenue in SAS Visual Analytics</title>
    <link>https://communities.sas.com/t5/SAS-Visual-Analytics/sas-va-calculate-rate-between-first-N-revenue-and-total-revenue/m-p/463643#M10238</link>
    <description>&lt;P&gt;hi, i am new in SAS VA , i have a table like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id revenue&lt;/P&gt;&lt;P&gt;1 10&lt;/P&gt;&lt;P&gt;2 50&lt;/P&gt;&lt;P&gt;3 4&lt;/P&gt;&lt;P&gt;4 15&lt;/P&gt;&lt;P&gt;5 12&lt;/P&gt;&lt;P&gt;6 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the user need to choose a rank to see the first N id (eg first 3 id with max revenue: 2, 4 and 6) and have the rate between (50+15+25)/(10+50+4+15+12+25)= 0,77....&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 20 May 2018 16:43:41 GMT</pubDate>
    <dc:creator>rufmau68</dc:creator>
    <dc:date>2018-05-20T16:43:41Z</dc:date>
    <item>
      <title>sas va calculate rate between first N revenue and total revenue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/sas-va-calculate-rate-between-first-N-revenue-and-total-revenue/m-p/463643#M10238</link>
      <description>&lt;P&gt;hi, i am new in SAS VA , i have a table like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id revenue&lt;/P&gt;&lt;P&gt;1 10&lt;/P&gt;&lt;P&gt;2 50&lt;/P&gt;&lt;P&gt;3 4&lt;/P&gt;&lt;P&gt;4 15&lt;/P&gt;&lt;P&gt;5 12&lt;/P&gt;&lt;P&gt;6 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the user need to choose a rank to see the first N id (eg first 3 id with max revenue: 2, 4 and 6) and have the rate between (50+15+25)/(10+50+4+15+12+25)= 0,77....&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 May 2018 16:43:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/sas-va-calculate-rate-between-first-N-revenue-and-total-revenue/m-p/463643#M10238</guid>
      <dc:creator>rufmau68</dc:creator>
      <dc:date>2018-05-20T16:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: sas va calculate rate between first N revenue and total revenue</title>
      <link>https://communities.sas.com/t5/SAS-Visual-Analytics/sas-va-calculate-rate-between-first-N-revenue-and-total-revenue/m-p/473716#M10556</link>
      <description>&lt;P&gt;There are a couple ways to get what you want, but I think the most flexible way is to create a parameter 'topN_cutoff' and a calculation 'topN_revenue' like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if 'revenue'n &amp;gt; 'topN_cutoff'&lt;/P&gt;
&lt;P&gt;return&amp;nbsp;'revenue'n&lt;/P&gt;
&lt;P&gt;else 0&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can create an aggregated calculation like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sum [_ForAll_] ('topN_revenue'n) / sum [_ForAll_] ( 'revenue'n )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only sticky point is that you need to know what the cutoff revenue is beforehand. &amp;nbsp;For any given data, it is easy to find it out with a list table and a rank applied for top 3 (or whatever rank). &amp;nbsp;But I don't think VA has an operator you can use to determine it automatically. &amp;nbsp;The closest would be the Percentile operator which gives you the revenue value in the data for a specified percentile, but that won't correspond to a specific numeric rank (unless, again, you already know the data and can just determine what percentile corresponds with top N).&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 13:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Visual-Analytics/sas-va-calculate-rate-between-first-N-revenue-and-total-revenue/m-p/473716#M10556</guid>
      <dc:creator>MikeJenista</dc:creator>
      <dc:date>2018-06-27T13:16:33Z</dc:date>
    </item>
  </channel>
</rss>

