<?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: Calculate and Assign Decile on load in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921835#M987954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain if you are getting error on your nested If or FRACTILE() function is causing the issue ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;BKC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Aug 2015 05:35:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-08-03T05:35:11Z</dc:date>
    <item>
      <title>Calculate and Assign Decile on load</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921830#M987942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a dataset which contains customers and their associated profit value.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am trying to create a decile view of this data by assigning each customer a decile value during the load script.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Whilst researching this problem in the QlikView Community I have managed to reuse a calculated dimension suggested for a similar problem.&amp;nbsp; The expression is formatted like this;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;=IF(PROFIT &amp;lt;= FRACTILE(TOTAL PROFIT, 0.1), 'Decile01',&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(PROFIT &amp;lt;= FRACTILE(TOTAL PROFIT, 0.2), 'Decile02',&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(PROFIT &amp;lt;= FRACTILE(TOTAL PROFIT, 0.3), 'Decile03',&lt;/P&gt;&lt;P&gt;...etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....and this works for charts and tables and dynamic interaction (well almost - the distribution isnt exactly in 10% chunks but close).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG style="font-size: 12pt;"&gt;However&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt;"&gt;,&lt;/SPAN&gt; I want to able able to assign the Decile value\name as a fixed attribute for each customer during the load process so I'd have a new column called "DecileNumber" or similar.&amp;nbsp; Using a calculated dimension in the QVW layer doesn't give me the a fixed value that I can work with.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My real data set is quite large (i.e. several million customers).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any suggestions appreciated!&lt;/P&gt;&lt;P&gt;JW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 12:05:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921830#M987942</guid>
      <dc:creator />
      <dc:date>2015-07-30T12:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate and Assign Decile on load</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921831#M987944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load customer,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;F(PROFIT &amp;lt;= FRACTILE(TOTAL PROFIT, 0.1), 'Decile01',&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; IF(PROFIT &amp;lt;= FRACTILE(TOTAL PROFIT, 0.2), 'Decile02',&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&amp;nbsp; IF(PROFIT &amp;lt;= FRACTILE(TOTAL PROFIT, 0.3), 'Decile03'))) as Decile&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;From table&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;group by customer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 12:18:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921831#M987944</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-07-30T12:18:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate and Assign Decile on load</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921832#M987946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for script side load see attached example&lt;/P&gt;&lt;P&gt;You will get idea how to do this.&lt;/P&gt;&lt;P&gt;you need to modify the expression as required&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;BKC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 12:34:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921832#M987946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-07-30T12:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate and Assign Decile on load</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921833#M987948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the response.&amp;nbsp; When I use the suggested script I get a failure on load;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Aggregation expression required by Group by clause&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 13:52:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921833#M987948</guid>
      <dc:creator />
      <dc:date>2015-07-30T13:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate and Assign Decile on load</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921834#M987951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp; I have tried this and it almost works but I can't get the nested IF statement to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any ideas on what the syntax should be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 14:37:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921834#M987951</guid>
      <dc:creator />
      <dc:date>2015-07-30T14:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate and Assign Decile on load</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921835#M987954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain if you are getting error on your nested If or FRACTILE() function is causing the issue ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;BKC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 05:35:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921835#M987954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-03T05:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate and Assign Decile on load</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921836#M987957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Balkumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working with your example QVW and I have updated example to include 10 customers (A to K).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your exampke you commented that I needed to "Input my IF Statement here" but I have got stuck trying expand the IF statement in your example QVW by using IF statements applied to the&lt;EM&gt; vTotalSales&lt;/EM&gt; variable that you created.&amp;nbsp; When that didnt work I also tried using the FRACTILE statements which I applied to TOTAL Sales. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attached text file shows the 4 examples I have tried (commented) and their outcomes.&amp;nbsp; None of these worked. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on these 10 example customers and the way which I have applied the example sales value, the desired outcome would be for each customer to be in 1 of the deciles. Of course my "real" problem data is &lt;EM&gt;customer&lt;/EM&gt; and &lt;EM&gt;profit&lt;/EM&gt; but if I can get your example QVW to display what I need then I can adapt to my real problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;JW&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 09:54:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-and-Assign-Decile-on-load/m-p/921836#M987957</guid>
      <dc:creator />
      <dc:date>2015-08-03T09:54:30Z</dc:date>
    </item>
  </channel>
</rss>

