<?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: Returning a value based on a threshold in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1709659#M451668</link>
    <description>&lt;P&gt;If you want to do it on the script, you can use the &lt;A href="https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/LoadData/matching-intervals-to-discrete-data.htm" target="_self"&gt;IntervalMatch&lt;/A&gt; function.&lt;/P&gt;&lt;P&gt;Basicallly you setup the lower and upper intervals for each multiplier, and then mix it with the Sales data.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jun 2020 08:28:09 GMT</pubDate>
    <dc:creator>fosuzuki</dc:creator>
    <dc:date>2020-06-10T08:28:09Z</dc:date>
    <item>
      <title>Returning a value based on a threshold</title>
      <link>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1709639#M451666</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;Qlikview newbie here. I am working on sales report in which a sales bonus must be calculated from a multiplier, which is based on a threshold from another table. Example of the data:&lt;/P&gt;&lt;TABLE width="456"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="64"&gt;Name&lt;/TD&gt;&lt;TD width="84"&gt;Sales Target&lt;/TD&gt;&lt;TD width="90"&gt;Actual Sales&lt;/TD&gt;&lt;TD width="94"&gt;% of target&lt;/TD&gt;&lt;TD width="124"&gt;&lt;FONT color="#FF0000"&gt;Bonus multiplier&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;103&lt;/TD&gt;&lt;TD&gt;103%&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;1.2&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;TD&gt;140&lt;/TD&gt;&lt;TD&gt;70%&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;0&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;TD&gt;133%&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;1.9&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;TD&gt;402&lt;/TD&gt;&lt;TD&gt;100.50%&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;"Bonus multiplier" is the field, for which I cannot figure out the expression. I suppose that logic should be is to take the value from "% of target", compare it against the threshold table below:&lt;/P&gt;&lt;TABLE width="162"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="73"&gt;Threshold&lt;/TD&gt;&lt;TD width="89"&gt;Multiplier&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;0%&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;80%&lt;/TD&gt;&lt;TD&gt;0.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;85%&lt;/TD&gt;&lt;TD&gt;0.7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;90%&lt;/TD&gt;&lt;TD&gt;0.8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;95%&lt;/TD&gt;&lt;TD&gt;0.9&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;100%&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;101%&lt;/TD&gt;&lt;TD&gt;1.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;105%&lt;/TD&gt;&lt;TD&gt;1.3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;110%&lt;/TD&gt;&lt;TD&gt;1.4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;115%&lt;/TD&gt;&lt;TD&gt;1.6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;120%&lt;/TD&gt;&lt;TD&gt;1.8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;125%&lt;/TD&gt;&lt;TD&gt;1.9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;and return multiplier value for the highest achieved threshold. However, I have no idea how to write this is expression. I thought of using a match function, but it would ignore the values that fall inbetween the thresholds.&lt;/P&gt;&lt;P&gt;Has anyone worked on this type of problem before?&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated,&lt;/P&gt;&lt;P&gt;Niklavs.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 07:40:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1709639#M451666</guid>
      <dc:creator>WcdSwami</dc:creator>
      <dc:date>2020-06-10T07:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a value based on a threshold</title>
      <link>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1709659#M451668</link>
      <description>&lt;P&gt;If you want to do it on the script, you can use the &lt;A href="https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/LoadData/matching-intervals-to-discrete-data.htm" target="_self"&gt;IntervalMatch&lt;/A&gt; function.&lt;/P&gt;&lt;P&gt;Basicallly you setup the lower and upper intervals for each multiplier, and then mix it with the Sales data.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 08:28:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1709659#M451668</guid>
      <dc:creator>fosuzuki</dc:creator>
      <dc:date>2020-06-10T08:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a value based on a threshold</title>
      <link>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1710109#M451694</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28676"&gt;@fosuzuki&lt;/a&gt;,&amp;nbsp;thank you for the suggestion, I was not aware of the IntervalMatch function! However, in this case, the solution needs to be built within the table.&lt;/P&gt;&lt;P&gt;After further reading on the set analysis I found out that set analysis calculates only once per table, not once per row. Hence, if I understand correctly, its not possible to create a solution with set analysis and the only way how to implement this is in the load script?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 08:55:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1710109#M451694</guid>
      <dc:creator>WcdSwami</dc:creator>
      <dc:date>2020-06-11T08:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a value based on a threshold</title>
      <link>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1718091#M451701</link>
      <description>&lt;P&gt;Using IntervalMatch.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tab1:
LOAD * INLINE [
    Name, Sales Target, Actual Sales, % of target
    A, 100, 103, 103%
    B, 200, 140, 70%
    C, 300, 400, 133%
    D, 400, 402, 100.50%
];

tabTH:
LOAD * INLINE [
    Thmin, Thmax, Bonus Multiplier
    0%, 79%, 0
    80%, 84%, 0.5
    85%, 89%, 0.7
    90%, 94%, 0.8
    95%, 99%, 0.9
    100%, 101%, 1
    101%, 104%, 1.2
    105%, 109%, 1.3
    110%, 114%, 1.4
    115%, 119%, 1.6
    120%, 124%, 1.8
    125%, 200%, 1.9
];

Inner Join
IntervalMatch([% of target])
LOAD Thmin, Thmax
Resident tabTH;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 Jun 2020 21:40:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1718091#M451701</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-06-11T21:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a value based on a threshold</title>
      <link>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1718095#M451702</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV17.PNG" style="width: 414px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/35398i73F8115E732D57FD/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV17.PNG" alt="commQV17.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 21:42:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1718095#M451702</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-06-11T21:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Returning a value based on a threshold</title>
      <link>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1718167#M451703</link>
      <description>&lt;P&gt;Thank you for the input, I think IntervalMatch is the closest we can get to a "solution" in this case.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 06:32:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Returning-a-value-based-on-a-threshold/m-p/1718167#M451703</guid>
      <dc:creator>WcdSwami</dc:creator>
      <dc:date>2020-06-12T06:32:24Z</dc:date>
    </item>
  </channel>
</rss>

