<?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: Re: Dynamic Bucket Value Based on Calculated Percentage in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708091#M255083</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is a solution I can think of. This is not the best of solutions but will work since the no. of buckets is only 5 and wont change.&lt;/P&gt;&lt;P&gt;One of the main challenges is that the Bucket table is an island and the resultant dynamic Compliance Value needs to be compared in that island table.&lt;/P&gt;&lt;P&gt;Please take a look at the back-end variables and the expression for the bucket name on the front-end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope its of some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jul 2014 20:34:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-07-18T20:34:22Z</dc:date>
    <item>
      <title>Dynamic Bucket Value Based on Calculated Percentage</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708088#M255080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a straight table with one of my expression columns being an aggregated average calculation based on a start and end date selected by the user. Using that percentage value, I am trying to calculate and display a bucket category based on whether it falls between a low and high range defined in a lookup table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of what the output should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Firm&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Role&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Underlying&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Compliance %&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Bucket&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Company abc&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;DPM&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;XYZ&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;95.123&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Company def&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;MM&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;ZYX&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;92&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The expression for Compliance % is :&lt;/P&gt;&lt;P&gt;=Aggr( AVG( if (TRADE_DATE &amp;gt;= $(vStartDate) AND TRADE_DATE &amp;lt;= $(vEndDate), COMPLIANCE_PCT) ), FIRM_NAME, RESP_ROLE_TYPE_CODE, UNDER_SEC_SYM)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My list of bucket categories is a lookup table that is not linked to any other table because the percentage column is dynamic and is recalculated each time the user selects a different start and end date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Bucket&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;LowValue&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;High Value&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;95&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;99&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;90&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;94.99&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;....&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;....&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bucket ranges can change in the future and need this to be dynamic, so using If statements is not a solution for this. I tried the following expression for the Bucket column but it does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= if ( $(vEndDate) &amp;gt;= START_DATE AND $(vEndDate) &amp;lt;= END_DATE,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( [Compliance %] &amp;gt;= LOW_RANGE AND [Compliance %] &amp;lt;= HIGH_RANGE, BUCKET)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anybody know how to achieve something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 19:31:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708088#M255080</guid>
      <dc:creator />
      <dc:date>2014-07-18T19:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Bucket Value Based on Calculated Percentage</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708089#M255081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edgar,&lt;/P&gt;&lt;P&gt;This is a very interesting case. Let me ask you a question. How many buckets would you have. You mentioned the bucket ranges can change, but will the number of buckets itself change? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 20:12:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708089#M255081</guid>
      <dc:creator />
      <dc:date>2014-07-18T20:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Bucket Value Based on Calculated Percentage</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708090#M255082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ajay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The buckets range from A - E. The number of buckets will not change, only the ranges could change in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Edgar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 20:17:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708090#M255082</guid>
      <dc:creator />
      <dc:date>2014-07-18T20:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Dynamic Bucket Value Based on Calculated Percentage</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708091#M255083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attached is a solution I can think of. This is not the best of solutions but will work since the no. of buckets is only 5 and wont change.&lt;/P&gt;&lt;P&gt;One of the main challenges is that the Bucket table is an island and the resultant dynamic Compliance Value needs to be compared in that island table.&lt;/P&gt;&lt;P&gt;Please take a look at the back-end variables and the expression for the bucket name on the front-end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope its of some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 20:34:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708091#M255083</guid>
      <dc:creator />
      <dc:date>2014-07-18T20:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Bucket Value Based on Calculated Percentage</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708092#M255084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Ajay! It's a step in the right direction. Will try this out on Monday.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; edgar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jul 2014 20:43:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-Bucket-Value-Based-on-Calculated-Percentage/m-p/708092#M255084</guid>
      <dc:creator />
      <dc:date>2014-07-18T20:43:30Z</dc:date>
    </item>
  </channel>
</rss>

