<?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: Find value in unrelated Table based on value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575028#M41885</link>
    <description>&lt;P&gt;Thank you again Sunny.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution works 'straight out of the box'.&lt;/P&gt;&lt;P&gt;I do think I will need to play around with the formatting as &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;, But the concept is spot-on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2019 12:26:21 GMT</pubDate>
    <dc:creator>johngouws</dc:creator>
    <dc:date>2019-04-30T12:26:21Z</dc:date>
    <item>
      <title>Find value in unrelated Table based on value</title>
      <link>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1574890#M41873</link>
      <description>&lt;P&gt;Hi.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sitting with a scenario where I need to show a % value from 1 Table, based on a % value from another table. What makes this 'interesting' is that the 2 table are not associated and the calculation cannot be done in the Load Script, because there is a variable that comes into play in the App front end. The user is able to change the variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In essence what I have is a Data table containing REP, Sales and Target fields. I have a second table, Lookup, which has a list of various Achievement percentages with a Incentive value for each&amp;nbsp;Achievement percentage.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I calculate the Achievement percentage (Sale/Target*variable) in the front end, this result needs to look in the Lookup table and return the related Incentive value. The attached App shows what I mean about the Variable the user can use. The script I have is :&amp;nbsp;&lt;/P&gt;&lt;P&gt;SET v_Company = '.02';&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;REP, Sales, Target&lt;BR /&gt;01, 2500, 2800&lt;BR /&gt;02, 4000, 3800&lt;BR /&gt;03, 2100, 2700];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Lookup:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Achieved_%, Lookup&lt;BR /&gt;75%, 5%&lt;BR /&gt;76%, 6%&lt;BR /&gt;77%, 7%&lt;BR /&gt;78%, 8%&lt;BR /&gt;79%, 8%&lt;BR /&gt;80%, 9%&lt;BR /&gt;81%, 9%&lt;BR /&gt;82%, 10%&lt;BR /&gt;83%, 10%&lt;BR /&gt;84%, 10%&lt;BR /&gt;85%, 11%&lt;BR /&gt;86%, 12%&lt;BR /&gt;87%, 13%&lt;BR /&gt;88%, 14%&lt;BR /&gt;89%, 14%&lt;BR /&gt;90%, 15%&lt;BR /&gt;91%, 15%&lt;BR /&gt;92%, 16%&lt;BR /&gt;93%, 16%&lt;BR /&gt;94%, 17%&lt;BR /&gt;95%, 17%&lt;BR /&gt;96%, 18%&lt;BR /&gt;97%, 18%&lt;BR /&gt;98%, 19%&lt;BR /&gt;99%, 19%&lt;BR /&gt;100%, 20%&lt;BR /&gt;101%, 20%&lt;BR /&gt;102%, 20%&lt;BR /&gt;103%, 20%&lt;BR /&gt;104%, 20%&lt;BR /&gt;105%, 20%&lt;BR /&gt;105%, 25%&lt;BR /&gt;107%, 25%&lt;BR /&gt;108%, 25%&lt;BR /&gt;109%, 25%&lt;BR /&gt;110%, 25%&lt;BR /&gt;111%, 25%&lt;BR /&gt;112%, 25%];&lt;/P&gt;&lt;P&gt;I greatly appreciate any help or suggestions with this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 09:04:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1574890#M41873</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2019-04-30T09:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Find value in unrelated Table based on value</title>
      <link>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1574982#M41877</link>
      <description>Create another variable with the expression achievement % ((Sale/Target*variable) )&lt;BR /&gt;and use this variable in set analysis to filter out the lookup value.</description>
      <pubDate>Tue, 30 Apr 2019 11:33:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1574982#M41877</guid>
      <dc:creator>miskinmaz</dc:creator>
      <dc:date>2019-04-30T11:33:04Z</dc:date>
    </item>
    <item>
      <title>Re: Find value in unrelated Table based on value</title>
      <link>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575007#M41880</link>
      <description>&lt;P&gt;To fetch the lookup-value you could use an expression like this one:&lt;/P&gt;&lt;P&gt;pick(match(round(Sales / Target * 100), $(=concat(Achieved_%, ','))), $(=concat(Lookup, ','))) / 100&lt;/P&gt;&lt;P&gt;Important is the rounding - maybe with floor/ceil instead of round - of your achivement-calculation so that it matches the values from your island-table. Personally I would probably use unformatted integer-values in this lookup-table to avoid any formatting-issues and the possible need to handle them as strings which would then require the use of quotes within the $-sign expansion and also additionally efforts to sort the concat to ensure a synchronization of lookup- and return-field.&lt;/P&gt;&lt;P&gt;Further you need to extend this table to all possible values or to apply some logic to fetch the not listed values - maybe with one or two if-loops and/or alt() and a range-function. Maybe something like this:&lt;/P&gt;&lt;P&gt;alt(pick(match(round(rangemin(Sales / Target * 100, 112)),&lt;BR /&gt;&amp;nbsp;&amp;nbsp; $(=concat(Achieved_%, ','))), $(=concat(Lookup, ','))) / 100, 0)&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 11:54:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575007#M41880</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-04-30T11:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Find value in unrelated Table based on value</title>
      <link>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575020#M41882</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;P&gt;num(Aggr(If(Round(Ceil(Sales/Target,0.1,0.1) * (1- $(v_Company))*100)/100 = [Achieved_%], Lookup), [Achieved_%], REP))&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 12:03:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575020#M41882</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-30T12:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Find value in unrelated Table based on value</title>
      <link>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575028#M41885</link>
      <description>&lt;P&gt;Thank you again Sunny.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your solution works 'straight out of the box'.&lt;/P&gt;&lt;P&gt;I do think I will need to play around with the formatting as &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;, But the concept is spot-on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 12:26:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575028#M41885</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2019-04-30T12:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find value in unrelated Table based on value</title>
      <link>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575033#M41886</link>
      <description>&lt;P&gt;I agree, my expression is to guide you in the general direction, but you will have to fine tune this based on your requirement. Things such as round, ceil, floor etc will have to be decided to make sure you get to the correct lookup value, but that something you should be able to figure out based on the expression.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 12:30:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575033#M41886</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-04-30T12:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Find value in unrelated Table based on value</title>
      <link>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575034#M41887</link>
      <description>&lt;P&gt;Hi Marcus,&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I have some time I am going to try out your solution as well.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 12:30:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Find-value-in-unrelated-Table-based-on-value/m-p/1575034#M41887</guid>
      <dc:creator>johngouws</dc:creator>
      <dc:date>2019-04-30T12:30:35Z</dc:date>
    </item>
  </channel>
</rss>

