<?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 nearest Min and nearest Max in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168726#M892990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).&lt;/P&gt;&lt;P&gt;If not, please make clear what part of this topic you still need help with &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Aug 2016 08:37:46 GMT</pubDate>
    <dc:creator>oknotsen</dc:creator>
    <dc:date>2016-08-11T08:37:46Z</dc:date>
    <item>
      <title>Calculate nearest Min and nearest Max</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168721#M892982</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;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Rate&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Profit&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Loss&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Sand&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;5000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;1000&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;501&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Acrylic Mixture&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;7000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1500&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;496&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Fly Ash Bricks&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;505&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Polyurathene&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;7500&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2500&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data like above say around 50,000 rows. What I want is Nearest Loss to 500 (means from 496 to 505 Loss amount) when I give Input as 500 in Inputfield, I should be able to see above related data to Loss amount 500.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want similar data for 246 to 255 for Loss Amount 250; Similar data for 996 to 1005 for Loss Amount 1000. How to calculate in Straight Box in UI level or in Script Level.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168721#M892982</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate nearest Min and nearest Max</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168722#M892983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find solution attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some explanation:&lt;/P&gt;&lt;P&gt;1. I have added two fake rows, to test if logic works:&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14708529091601156" jivemacro_uid="_14708529091601156"&gt;
&lt;P&gt;LOAD * INLINE [&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID, Product, Rate, Profit, Loss&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, Sand, 5000,&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000,&amp;nbsp;&amp;nbsp;&amp;nbsp; 501&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, Acrylic Mixture, 7000, 1500, 496&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, Fly Ash Bricks, 9000, 2000, 505&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, Polyurathene, 7500, 2500, 500&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, aaa,1,1,1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6, bbb,232323,3433445,22452&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Created &lt;STRONG&gt;vInputLoss &lt;/STRONG&gt;variable, and added Input box containing it on the screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. using input box, value 500 was assigned to the variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. I have created a chart with your dimensions and below expression (labelled it "expr"):&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14708529326294217" jivemacro_uid="_14708529326294217"&gt;
&lt;P&gt;IF(Loss &amp;gt; ($(vInputLoss)-5) AND Loss &amp;lt;= ($(vInputLoss) +5),1,0)&lt;/P&gt;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. In Presentation tab, Columns section, i clicked on expr column and marked it to be hidden&lt;/P&gt;&lt;P&gt;6. In Presentation tab of the chart I set "Supress zero values"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression resolves to 0 for all rows not fulfilling the criteria, which are then removed from the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Kuba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 18:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168722#M892983</guid>
      <dc:creator />
      <dc:date>2016-08-10T18:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate nearest Min and nearest Max</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168723#M892984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;create a straight table chart&lt;/P&gt;&lt;P&gt;Add product as dimension&lt;/P&gt;&lt;P&gt;Add Rate and Profit as dimensions&lt;/P&gt;&lt;P&gt;Add expression:&lt;/P&gt;&lt;P&gt;=SUM(IF(Loss &amp;gt;= $(vInput)-$(vVariation) AND Loss &amp;lt;= $(vInput) +&lt;SPAN style="font-size: 13.3333330154419px;"&gt;$(vVariation)&lt;/SPAN&gt;,Loss,0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where vInput will be your Loss value and vVariation the variation (5 in your case)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for filtering the values outside Loss +- variation check suppress zero values in the Presentation tab of the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 18:25:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168723#M892984</guid>
      <dc:creator>santiago_respane</dc:creator>
      <dc:date>2016-08-10T18:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate nearest Min and nearest Max</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168724#M892986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I created variables vRate,vProfit,vLoss and vFlag&lt;/P&gt;&lt;P&gt;In Table Dimension&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;Pick&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Match&lt;/SPAN&gt;(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vFlag&lt;/EM&gt;&lt;/STRONG&gt;,1,2,3),&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Rate&lt;/SPAN&gt;) &amp;gt;= &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vRate&lt;/EM&gt;&lt;/STRONG&gt;*(1-(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vNum&lt;/EM&gt;&lt;/STRONG&gt;)) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Rate&lt;/SPAN&gt;) &amp;lt;= &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vRate&lt;/EM&gt;&lt;/STRONG&gt;*(1+(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vNum&lt;/EM&gt;&lt;/STRONG&gt;)),&lt;SPAN style="color: #800000;"&gt;Product&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;Product&lt;/SPAN&gt;),&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Profit&lt;/SPAN&gt;) &amp;gt;= &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vProfit&lt;/EM&gt;&lt;/STRONG&gt;*(1-(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vNum&lt;/EM&gt;&lt;/STRONG&gt;)) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Profit&lt;/SPAN&gt;) &amp;lt;= &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vProfit&lt;/EM&gt;&lt;/STRONG&gt;*(1+(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vNum&lt;/EM&gt;&lt;/STRONG&gt;)),&lt;SPAN style="color: #800000;"&gt;Product&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;Product&lt;/SPAN&gt;),&lt;BR /&gt; &lt;SPAN style="color: #0000ff;"&gt;Aggr&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;If&lt;/SPAN&gt;(&lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Loss&lt;/SPAN&gt;) &amp;gt;= &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vLoss&lt;/EM&gt;&lt;/STRONG&gt;*(1-(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vNum&lt;/EM&gt;&lt;/STRONG&gt;)) &lt;SPAN style="color: #0000ff;"&gt;and&lt;/SPAN&gt; &lt;SPAN style="color: #0000ff;"&gt;Sum&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;Loss&lt;/SPAN&gt;) &amp;lt;= &lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vRate&lt;/EM&gt;&lt;/STRONG&gt;*(1+(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;vNum&lt;/EM&gt;&lt;/STRONG&gt;)),&lt;SPAN style="color: #800000;"&gt;Product&lt;/SPAN&gt;),&lt;SPAN style="color: #800000;"&gt;Product&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-size: 10pt;"&gt; ) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Aggregation is ID,Product&lt;/P&gt;&lt;P&gt;Varible vNum is % of Value (+/-)&lt;/P&gt;&lt;P&gt;You have a look at Document Trigger&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/134252_pastedImage_3.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;You &lt;STRONG&gt;&lt;SPAN style="color: #575757;"&gt;don't&lt;/SPAN&gt; need to click on Text box&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;See attachment&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2016 19:57:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168724#M892986</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2016-08-10T19:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate nearest Min and nearest Max</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168725#M892988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Everyone. I shall definitely try and let u know If I have succeeded or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2016 06:50:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168725#M892988</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-11T06:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate nearest Min and nearest Max</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168726#M892990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).&lt;/P&gt;&lt;P&gt;If not, please make clear what part of this topic you still need help with &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2016 08:37:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168726#M892990</guid>
      <dc:creator>oknotsen</dc:creator>
      <dc:date>2016-08-11T08:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate nearest Min and nearest Max</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168727#M892991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's working. I'm trying to convert the same into SET analysis. Can you please help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2016 09:20:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-nearest-Min-and-nearest-Max/m-p/1168727#M892991</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-11T09:20:24Z</dc:date>
    </item>
  </channel>
</rss>

