<?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: Need an inverse to the Pick function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813767#M287080</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you could define your expression-result to a integer value like 0,1,2,3 ... your max. value - then you could per excel or a loop generate a list or table which contains these values and their matching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example for Buckets:&lt;/P&gt;&lt;P&gt;if(value &amp;gt;= 0 and value &amp;lt;= 100, 10,&lt;/P&gt;&lt;P&gt;if(value &amp;gt; 100 and value &amp;lt;= 200, 20,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not overlapping meant: the first if couldn't go until 90 as value and the second couldn't have 30 as bucket-size then it wouldn't match properly. In most cases the calculations are correct but the dimension showed wrong clusters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jan 2015 17:04:08 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-01-19T17:04:08Z</dc:date>
    <item>
      <title>Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813762#M287075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm building some fractile calculation into a tool, and while what I have currently works, it's not very fast.&amp;nbsp; What I need is a function that essentially works as an inverse to a Pick function where there are a list of possible conditions, and it returns the place the first passing condition falls in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way I'm doing it currently is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Calculate all of the max values for each decile bucket:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vE_Decile_1_max = fractile($(vE_Decile_max_Calc),0.1)&lt;/P&gt;&lt;P&gt;vE_Decile_2_max = fractile($(vE_Decile_max_Calc),0.2)&lt;/P&gt;&lt;P&gt;vE_Decile_3_max = fractile($(vE_Decile_max_Calc),0.3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then running it through a big if statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if($(vE_PP_Total_Sales) &amp;lt;= $(vE_Decile_1_max), 1,&lt;/P&gt;&lt;P&gt;if($(vE_PP_Total_Sales) &amp;lt;= $(vE_Decile_2_max), 2,&lt;/P&gt;&lt;P&gt;if($(vE_PP_Total_Sales) &amp;lt;= $(vE_Decile_3_max), 3,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While this works, it's slow.&amp;nbsp; I don't believe the class function will work either since the buckets aren't the same size.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone have any ideas on how to speed this up?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Spencer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 15:16:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813762#M287075</guid>
      <dc:creator />
      <dc:date>2015-01-19T15:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813763#M287076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use Switch Statment...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 15:37:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813763#M287076</guid>
      <dc:creator />
      <dc:date>2015-01-19T15:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813764#M287077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not doing this in the script but rather in the tool itself as it needs to be responsive to selections.&amp;nbsp; Is there an analogous function for inside the tool?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 15:46:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813764#M287077</guid>
      <dc:creator />
      <dc:date>2015-01-19T15:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813765#M287078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you could find some logic to defined your expressions to certain results - most often through ceil() or floor() - it is possible to use a pick(match()) instead a nested if-loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-message-small" data-containerid="2051" data-containertype="14" data-objectid="593232" data-objecttype="2" href="http://community.qlik.com/message/593232#593232"&gt;http://community.qlik.com/message/593232#593232&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also a class() could be possible then the buckets could be per if-loop general various if the buckets-ranges don't overlap eachother.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Further you could simplify your expressions with parametrized variables like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vE_Decile_max = fractile($(vE_Decile_max_Calc),$1)&lt;/P&gt;&lt;P&gt;and then &lt;/P&gt;&lt;P&gt;if($(vE_PP_Total_Sales) &amp;lt;= $(vE_Decile_max(0.1)), 1, ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 15:51:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813765#M287078</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-01-19T15:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813766#M287079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah I had thought about trying to use the ceiling function to force a matchable value, but since the values aren't following any kind of equation, it would be tough to find a transformation that would work universally.&amp;nbsp; It may be possible, but would take too long.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you be able to expand on this statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also a class() could be possible then the buckets could be per if-loop general various if the buckets-ranges don't overlap eachother.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not really sure what you were trying to say.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parameter idea is a good one though.&amp;nbsp; I didn't realize that was possible.&amp;nbsp; I'll try implementing that now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 16:28:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813766#M287079</guid>
      <dc:creator />
      <dc:date>2015-01-19T16:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813767#M287080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you could define your expression-result to a integer value like 0,1,2,3 ... your max. value - then you could per excel or a loop generate a list or table which contains these values and their matching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example for Buckets:&lt;/P&gt;&lt;P&gt;if(value &amp;gt;= 0 and value &amp;lt;= 100, 10,&lt;/P&gt;&lt;P&gt;if(value &amp;gt; 100 and value &amp;lt;= 200, 20,&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not overlapping meant: the first if couldn't go until 90 as value and the second couldn't have 30 as bucket-size then it wouldn't match properly. In most cases the calculations are correct but the dimension showed wrong clusters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 17:04:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813767#M287080</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-01-19T17:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813768#M287081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would this work with dynamic buckets? Because the limits on each bucket change with the selections.&amp;nbsp; The class function requires uniform buckets right? If I could define a class function with specifiable range values then that would be perfect, but I don't think this is possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Overlapping buckets isn't a problem, and I have the range from 0 to the max possible value completely covered which makes that aspect a little easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help in all this though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 17:20:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813768#M287081</guid>
      <dc:creator />
      <dc:date>2015-01-19T17:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813769#M287082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please provide sample data and expected output.&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;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 22:35:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813769#M287082</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2015-01-19T22:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813770#M287083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually I borrowed a "Decile Analysis" from QlikFix.com and modified the expression from a nested IF into a pure calculation like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2015-01-19 Fractile.PNG" class="image-1 jive-image" src="/legacyfs/online/75697_2015-01-19 Fractile.PNG" style="height: 293px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;As the different deciles are added you get a result of 1,2,5,9,14,20,27,35,44,54 which corresponds to 1..10 - hence the Match() to convert into the right decile ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to different hints and tips found on Qlik Community and elsewhere like books ... the calculation should be significantly quicker than using ifs - I leave the testing for you though ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 23:31:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813770#M287083</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-01-19T23:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813771#M287084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Acually I couldn't resist giving it a test - Ifs versus pure calculation on 1 million customers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ifs took on average 1780 milliseconds to recalculate. Calculation too on average around 2900 milliseconds if using the Match() and without the Match() it took 1580 milliseconds ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 00:05:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813771#M287084</guid>
      <dc:creator>petter</dc:creator>
      <dc:date>2015-01-20T00:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813772#M287085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Petter's solution actually did the trick.&amp;nbsp; Thanks for looking at this though!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spencer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 14:48:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813772#M287085</guid>
      <dc:creator />
      <dc:date>2015-01-20T14:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Need an inverse to the Pick function</title>
      <link>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813773#M287086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes this worked perfectly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hadn't considered reducing the the individual comparisons to boolean and summing up individual possibilities.&amp;nbsp; Thanks for the help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 14:49:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-an-inverse-to-the-Pick-function/m-p/813773#M287086</guid>
      <dc:creator />
      <dc:date>2015-01-20T14:49:42Z</dc:date>
    </item>
  </channel>
</rss>

