<?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 Need help adjusting a Top/Bottom percentage by sales measure in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Need-help-adjusting-a-Top-Bottom-percentage-by-sales-measure/m-p/2489331#M101791</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The end goal of the measure I am working on is to be able to count the number of suppliers that account for the bottom 80% of their spend.&lt;/P&gt;
&lt;P&gt;I was able to do so, by first creating a formula for assigning a label to the top 20% and to the bottom 80%:&lt;/P&gt;
&lt;P&gt;Aggr(&lt;BR /&gt;If(Rangesum(Above(Sum({1} [Invoice Amt$])/Sum({1} total [Invoice Amt$]),1,RowNo()))&amp;lt;0.2, 'Top',&lt;BR /&gt;'Bottom'),&lt;BR /&gt;([Vendor Name],(=Sum({1} [Invoice Amt$]),Desc))&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;After I confirmed that the above formula was working by placing it in a table along with the Vendor Name, the Invoice Amt$, I then created a KPI to do the count of the bottom 80%:&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;[Vendor Name]={"=Aggr(Rangesum(Above(Sum({1} [Invoice Amt$])/Sum({1} total [Invoice Amt$]),1,RowNo()))&amp;gt;=0.2,([Vendor Name],(=Sum({1} [Invoice Amt$]),Desc)))"} &amp;gt;}&lt;/P&gt;
&lt;P&gt;(I merely changed the &amp;lt;0.2 to &amp;gt;=0.2), which worked like a charm.&lt;/P&gt;
&lt;P&gt;But now here's where I need your help:&lt;/P&gt;
&lt;P&gt;I need to be able to filter by 2 dimensions, Category1 and Category2, and have the top 20% and bottom 80% still work, so that if they filter for example by category1= X, then the KPI will show the count of the Vendor Name that make up the bottom 80% of spend in that category.&lt;/P&gt;
&lt;P&gt;Can someone help me adjust the "main" measure so I can validate results by adding to the above-mentioned table the 2 categories (Catgory1 and Category2)? And then from there I believe I can easily change the KPI measure to replicate, as I did for my current measure.&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Sun, 27 Oct 2024 23:52:38 GMT</pubDate>
    <dc:creator>Adfc14</dc:creator>
    <dc:date>2024-10-27T23:52:38Z</dc:date>
    <item>
      <title>Need help adjusting a Top/Bottom percentage by sales measure</title>
      <link>https://community.qlik.com/t5/App-Development/Need-help-adjusting-a-Top-Bottom-percentage-by-sales-measure/m-p/2489331#M101791</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;The end goal of the measure I am working on is to be able to count the number of suppliers that account for the bottom 80% of their spend.&lt;/P&gt;
&lt;P&gt;I was able to do so, by first creating a formula for assigning a label to the top 20% and to the bottom 80%:&lt;/P&gt;
&lt;P&gt;Aggr(&lt;BR /&gt;If(Rangesum(Above(Sum({1} [Invoice Amt$])/Sum({1} total [Invoice Amt$]),1,RowNo()))&amp;lt;0.2, 'Top',&lt;BR /&gt;'Bottom'),&lt;BR /&gt;([Vendor Name],(=Sum({1} [Invoice Amt$]),Desc))&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;After I confirmed that the above formula was working by placing it in a table along with the Vendor Name, the Invoice Amt$, I then created a KPI to do the count of the bottom 80%:&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;[Vendor Name]={"=Aggr(Rangesum(Above(Sum({1} [Invoice Amt$])/Sum({1} total [Invoice Amt$]),1,RowNo()))&amp;gt;=0.2,([Vendor Name],(=Sum({1} [Invoice Amt$]),Desc)))"} &amp;gt;}&lt;/P&gt;
&lt;P&gt;(I merely changed the &amp;lt;0.2 to &amp;gt;=0.2), which worked like a charm.&lt;/P&gt;
&lt;P&gt;But now here's where I need your help:&lt;/P&gt;
&lt;P&gt;I need to be able to filter by 2 dimensions, Category1 and Category2, and have the top 20% and bottom 80% still work, so that if they filter for example by category1= X, then the KPI will show the count of the Vendor Name that make up the bottom 80% of spend in that category.&lt;/P&gt;
&lt;P&gt;Can someone help me adjust the "main" measure so I can validate results by adding to the above-mentioned table the 2 categories (Catgory1 and Category2)? And then from there I believe I can easily change the KPI measure to replicate, as I did for my current measure.&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Sun, 27 Oct 2024 23:52:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-help-adjusting-a-Top-Bottom-percentage-by-sales-measure/m-p/2489331#M101791</guid>
      <dc:creator>Adfc14</dc:creator>
      <dc:date>2024-10-27T23:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need help adjusting a Top/Bottom percentage by sales measure</title>
      <link>https://community.qlik.com/t5/App-Development/Need-help-adjusting-a-Top-Bottom-percentage-by-sales-measure/m-p/2489361#M101794</link>
      <description>&lt;P&gt;Please provide some sample data and expected output&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2024 06:52:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Need-help-adjusting-a-Top-Bottom-percentage-by-sales-measure/m-p/2489361#M101794</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2024-10-28T06:52:29Z</dc:date>
    </item>
  </channel>
</rss>

