<?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: *** Select field values based on variables *** in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Select-field-values-based-on-variables/m-p/271326#M496439</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DV,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use another Match() to return actual field values instead of aggregated values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Match(MyFieldName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chr(39) &amp;amp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concat(DISTINCT IF(Aggr(Count(DISTINCT MyMatch), My_ID)&amp;gt;= $(vMin) AND Aggr(Count(DISTINCT MyMatch),c_My) &amp;lt;= $(vMax), MyFieldName), Chr(39) &amp;amp; Chr(44) &amp;amp; Chr(39))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp; Chr(39)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ), MyFieldName)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check parentheses because I have not tested it and I may have missed some of them. The idea is that now you are showing not the result of an aggregation but, based on that aggregation, actual field values. The expression is quite complex, so it may take longer than expected to render.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jan 2012 15:48:55 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2012-01-12T15:48:55Z</dc:date>
    <item>
      <title>*** Select field values based on variables ***</title>
      <link>https://community.qlik.com/t5/QlikView/Select-field-values-based-on-variables/m-p/271325#M496438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Dear All,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;I have a quick question. Hope someone can answer this for me...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;I have two variable vMin &amp;amp; vMax. These two variables hold the values by using the slider object. Now I wanted to filter data in ListBox/Fieldbased on these two variables.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Here is the expression where I have used variables.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 9pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 9pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 9pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 9pt;"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-size: 9pt;"&gt;MyMatch&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-size: 9pt;"&gt;My_ID&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;)&amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="color: gray; font-size: 9pt;"&gt;$(vMin)&lt;/SPAN&gt; &lt;SPAN style="color: blue; font-size: 9pt;"&gt;AND&lt;/SPAN&gt; &lt;SPAN style="color: blue; font-size: 9pt;"&gt;Aggr&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 9pt;"&gt;Count&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 9pt;"&gt;DISTINCT&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-size: 9pt;"&gt;MyMatch&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;), &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-size: 9pt;"&gt;c_My&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;) &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: gray; font-size: 9pt;"&gt;$(vMax)&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-size: 9pt;"&gt;MyFieldName&lt;/SPAN&gt;&lt;SPAN style="color: black; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;If I use the above expression to generate MyFieldName ListBox,it works fine. However, I need to show the statistics (Count) of each item in MyFieldName. So I am assuming that I can't generate my MyFieldName by using the expression because I can't show the statistics. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;So I thought I would use “Select in field” action on variable change event. I mean when user changes the variables then relevant selection should be applied on MyFieldName ListBox.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;I hope this makes sense.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Thanks in advance.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Cheers - DV&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 15:38:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-field-values-based-on-variables/m-p/271325#M496438</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2012-01-12T15:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: *** Select field values based on variables ***</title>
      <link>https://community.qlik.com/t5/QlikView/Select-field-values-based-on-variables/m-p/271326#M496439</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DV,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use another Match() to return actual field values instead of aggregated values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Match(MyFieldName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(=&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chr(39) &amp;amp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concat(DISTINCT IF(Aggr(Count(DISTINCT MyMatch), My_ID)&amp;gt;= $(vMin) AND Aggr(Count(DISTINCT MyMatch),c_My) &amp;lt;= $(vMax), MyFieldName), Chr(39) &amp;amp; Chr(44) &amp;amp; Chr(39))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp; Chr(39)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ), MyFieldName)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check parentheses because I have not tested it and I may have missed some of them. The idea is that now you are showing not the result of an aggregation but, based on that aggregation, actual field values. The expression is quite complex, so it may take longer than expected to render.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 15:48:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-field-values-based-on-variables/m-p/271326#M496439</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-01-12T15:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: *** Select field values based on variables ***</title>
      <link>https://community.qlik.com/t5/QlikView/Select-field-values-based-on-variables/m-p/271327#M496440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Hi Miguel,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Thank you very much for quick response. I'll test this one and logically it makes sense. Just thinking ahead on performance issues. Is there a better approach to solve this issue. I think the best idea is to derive the slider values from field instead of dynamic variables. Because when I use the variables within expression then my selections are not at Document level rather object level. However, if I have the field in sliders then all the filters are applied at document level. &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;I'm not sure if there is a simple workaround to solve this issue. Any suggestions on this is really appreciated.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Thanks again for your help &amp;amp; time.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="font-family: trebuchet ms,geneva;"&gt;Cheers - DV&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jan 2012 16:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Select-field-values-based-on-variables/m-p/271327#M496440</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2012-01-12T16:22:12Z</dc:date>
    </item>
  </channel>
</rss>

