<?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: Pick top 2 values in list box? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460545#M561477</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this: =aggr(if(rank(Year)&amp;lt;=2,Year),Year)&lt;/P&gt;&lt;P&gt;If you want you could also replace the 2 with a variable so you can change the top x by changing the value of the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Mar 2013 13:13:22 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-03-20T13:13:22Z</dc:date>
    <item>
      <title>Pick top 2 values in list box?</title>
      <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460544#M561476</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;P&gt;&amp;nbsp; I have a list box which has values from 2008 to 2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I want the listbox to display current year and previous year ( ie 2012 and 2013)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I know this can be achieved using the expression inside the list box.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; My requirement is I don't want to hardcode year in order to pick top 2 values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I tried using the following expression inside the listbox&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if (year=max(year) or year=max(year-1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; But the thing is when I click on 2012 in the list box ,it show 2011.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Is there a way this can be achieved without hardcoding year values ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;SM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 12:53:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460544#M561476</guid>
      <dc:creator>swarup_malli</dc:creator>
      <dc:date>2013-03-20T12:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Pick top 2 values in list box?</title>
      <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460545#M561477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this: =aggr(if(rank(Year)&amp;lt;=2,Year),Year)&lt;/P&gt;&lt;P&gt;If you want you could also replace the 2 with a variable so you can change the top x by changing the value of the variable.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 13:13:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460545#M561477</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-03-20T13:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pick top 2 values in list box?</title>
      <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460546#M561478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you !!! Gysbert &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 13:15:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460546#M561478</guid>
      <dc:creator>swarup_malli</dc:creator>
      <dc:date>2013-03-20T13:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Pick top 2 values in list box?</title>
      <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460547#M561479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; When i make a selection in list box, say I choose 2013, then all other values disappear, how can I not make them disappear ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I don't want to hard code any year &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 18:23:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460547#M561479</guid>
      <dc:creator>swarup_malli</dc:creator>
      <dc:date>2013-03-21T18:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Pick top 2 values in list box?</title>
      <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460548#M561480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;=If(Match(Year, Max({1} Year), Max({1}Year)-1)), Year)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;=If(Match(Year, $(=Max({1} Year)), $(=Max({1} Year)-1)), Year)&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;Celambarasan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 19:54:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460548#M561480</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2013-03-21T19:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pick top 2 values in list box?</title>
      <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460549#M561481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the expresssion &lt;/P&gt;&lt;P&gt;=If(Match(Year, $(=Max({1} Year)), $(=Max({1} Year)-1)), Year) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wt does&amp;nbsp; {1} stand for ?&lt;/P&gt;&lt;P&gt;Balraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 20:01:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460549#M561481</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-04-12T20:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Pick top 2 values in list box?</title>
      <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460550#M561482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess {1}&amp;nbsp; represents the full &lt;SPAN style="background-color: #3399ff; color: #ffffff;"&gt;set&lt;/SPAN&gt; of all the records in the application&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Apr 2013 20:55:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460550#M561482</guid>
      <dc:creator>swarup_malli</dc:creator>
      <dc:date>2013-04-12T20:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pick top 2 values in list box?</title>
      <link>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460551#M561483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excellentooo..!! it solved dropdown filter issue. Thanks boss.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Feb 2014 18:43:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Pick-top-2-values-in-list-box/m-p/460551#M561483</guid>
      <dc:creator />
      <dc:date>2014-02-14T18:43:55Z</dc:date>
    </item>
  </channel>
</rss>

