<?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 Making BELOW() insensitive to user selections in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1635992#M507915</link>
    <description>&lt;P&gt;&lt;EM&gt;The title tells only part of the story. Apologies, but I really had no idea how to title this issue in a few words&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I was asked to provide a table that shows the daily value of sales and the value of sales on the same day one year ago.&lt;/P&gt;&lt;P&gt;The way I approached this was by creating a straight table having one dimension (date) and two metrics:&lt;/P&gt;&lt;P&gt;Sales = SUM(Sales)&lt;/P&gt;&lt;P&gt;Sales last year&amp;nbsp; = BELOW(SUM(Sales), 365)&lt;/P&gt;&lt;P&gt;This approach delivers as expected until the point the user starts fiddling with the Date Listbox, which is a necessary part of the deliverable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's assume that the first three rows in the table look as follows:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Sales last year&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.14&lt;/TD&gt;&lt;TD&gt;158 $&lt;/TD&gt;&lt;TD&gt;169 $&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.13&lt;/TD&gt;&lt;TD&gt;174 $&lt;/TD&gt;&lt;TD&gt;165 $&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.12&lt;/TD&gt;&lt;TD&gt;161 $&lt;/TD&gt;&lt;TD&gt;170 $&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the current setup, if the end user selects '2019.10.13' in the Listbox what will happen is that 'Sales last year' will turn to 0 (because the relevant row, that is supposed to be 365 places below simply does not "exist")&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Sales last year&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.13&lt;/TD&gt;&lt;TD&gt;174 $&lt;/TD&gt;&lt;TD&gt;0 $&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried different approaches with set analysis, e.g. by changing the second metric to:&lt;/P&gt;&lt;P&gt;Sales last year = BELOW(SUM{1} Sales), 365) which allows me to retain the 165 $ value but it also forces all dates to remain visible&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Sales Last Year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.14&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;169 $&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.13&lt;/TD&gt;&lt;TD&gt;174 $&lt;/TD&gt;&lt;TD&gt;165 $&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.12&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;170 $&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;None of the above outlined outcome matches the user experience that I want to deliver to my stakeholders. If a user selects only one date via listbox then the table should be reduced to one row, but both the Sales and Sales Last Year metrics should be populated with the correct data.&lt;/P&gt;&lt;P&gt;One solution that I can think of is to create the final table already at script execution time, but if there is a way to do it in the front-end, I would prefer it by far.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2019 11:27:46 GMT</pubDate>
    <dc:creator>imark</dc:creator>
    <dc:date>2019-10-16T11:27:46Z</dc:date>
    <item>
      <title>Making BELOW() insensitive to user selections</title>
      <link>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1635992#M507915</link>
      <description>&lt;P&gt;&lt;EM&gt;The title tells only part of the story. Apologies, but I really had no idea how to title this issue in a few words&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I was asked to provide a table that shows the daily value of sales and the value of sales on the same day one year ago.&lt;/P&gt;&lt;P&gt;The way I approached this was by creating a straight table having one dimension (date) and two metrics:&lt;/P&gt;&lt;P&gt;Sales = SUM(Sales)&lt;/P&gt;&lt;P&gt;Sales last year&amp;nbsp; = BELOW(SUM(Sales), 365)&lt;/P&gt;&lt;P&gt;This approach delivers as expected until the point the user starts fiddling with the Date Listbox, which is a necessary part of the deliverable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let's assume that the first three rows in the table look as follows:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Sales last year&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.14&lt;/TD&gt;&lt;TD&gt;158 $&lt;/TD&gt;&lt;TD&gt;169 $&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.13&lt;/TD&gt;&lt;TD&gt;174 $&lt;/TD&gt;&lt;TD&gt;165 $&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.12&lt;/TD&gt;&lt;TD&gt;161 $&lt;/TD&gt;&lt;TD&gt;170 $&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the current setup, if the end user selects '2019.10.13' in the Listbox what will happen is that 'Sales last year' will turn to 0 (because the relevant row, that is supposed to be 365 places below simply does not "exist")&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Sales last year&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.13&lt;/TD&gt;&lt;TD&gt;174 $&lt;/TD&gt;&lt;TD&gt;0 $&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried different approaches with set analysis, e.g. by changing the second metric to:&lt;/P&gt;&lt;P&gt;Sales last year = BELOW(SUM{1} Sales), 365) which allows me to retain the 165 $ value but it also forces all dates to remain visible&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;Sales Last Year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.14&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;169 $&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.13&lt;/TD&gt;&lt;TD&gt;174 $&lt;/TD&gt;&lt;TD&gt;165 $&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2019.10.12&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;170 $&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;None of the above outlined outcome matches the user experience that I want to deliver to my stakeholders. If a user selects only one date via listbox then the table should be reduced to one row, but both the Sales and Sales Last Year metrics should be populated with the correct data.&lt;/P&gt;&lt;P&gt;One solution that I can think of is to create the final table already at script execution time, but if there is a way to do it in the front-end, I would prefer it by far.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:27:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1635992#M507915</guid>
      <dc:creator>imark</dc:creator>
      <dc:date>2019-10-16T11:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Making BELOW() insensitive to user selections</title>
      <link>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1635995#M507916</link>
      <description>&lt;P&gt;Give this a shot&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Below(Sum{1} Sales), 365) * Avg(1)&lt;/LI-CODE&gt;&lt;P&gt;or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;=Below(Sum{&amp;lt;Date&amp;gt;} Sales), 365) * Avg(1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:31:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1635995#M507916</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-16T11:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Making BELOW() insensitive to user selections</title>
      <link>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1636036#M507917</link>
      <description>&lt;P&gt;Thank you! Both solutions work like a charm!&amp;nbsp; But I don't really understand why, in particular what the role of AVG(1) is.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 12:11:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1636036#M507917</guid>
      <dc:creator>imark</dc:creator>
      <dc:date>2019-10-16T12:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Making BELOW() insensitive to user selections</title>
      <link>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1636041#M507918</link>
      <description>&lt;P&gt;Avg(1) = 1 for your selections and 0 for out of selections.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 12:13:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Making-BELOW-insensitive-to-user-selections/m-p/1636041#M507918</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-16T12:13:44Z</dc:date>
    </item>
  </channel>
</rss>

