<?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 Distinct values of a field as parameter for Match function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635220#M232961</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;How can I get the list of distinct values of a field so I can pass it as parameters to the match function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Say I have the following INLINE data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="s1"&gt;DIRECTOR:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; * &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;[&lt;BR /&gt; Director Name&lt;BR /&gt; Jason&lt;BR /&gt; Chris&lt;BR /&gt; ]&lt;SPAN class="s1"&gt;;&lt;BR /&gt; &lt;BR /&gt; STAFF:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; * &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;[&lt;BR /&gt; Staff Name&lt;BR /&gt; Regis&lt;BR /&gt; Mark&lt;BR /&gt; Chris&lt;BR /&gt; David&lt;BR /&gt; Jason&lt;BR /&gt; Wee&lt;BR /&gt; ]&lt;SPAN class="s1"&gt;; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a table that shows me all staff and as expression "director" or "non-director" depending on whether it exists in the DIRECTOR table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried =&lt;SPAN class="s1"&gt;If&lt;/SPAN&gt;(&lt;SPAN class="s1"&gt;Match&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;[Staff Name]&lt;/SPAN&gt;,&lt;SPAN class="s2"&gt;[Director Name]&lt;/SPAN&gt;),'Director','Non-Director')&lt;/P&gt;&lt;P&gt;It works as long as I select something in the Director field. That's not what I want. I want the returned value to be independent from what is selected or not in the DIRECTOR list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 May 2014 18:34:58 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-05-15T18:34:58Z</dc:date>
    <item>
      <title>Distinct values of a field as parameter for Match function</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635220#M232961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;How can I get the list of distinct values of a field so I can pass it as parameters to the match function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Say I have the following INLINE data:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="s1"&gt;DIRECTOR:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; * &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;[&lt;BR /&gt; Director Name&lt;BR /&gt; Jason&lt;BR /&gt; Chris&lt;BR /&gt; ]&lt;SPAN class="s1"&gt;;&lt;BR /&gt; &lt;BR /&gt; STAFF:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; * &lt;/SPAN&gt;&lt;SPAN class="s2"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN class="s1"&gt; &lt;/SPAN&gt;[&lt;BR /&gt; Staff Name&lt;BR /&gt; Regis&lt;BR /&gt; Mark&lt;BR /&gt; Chris&lt;BR /&gt; David&lt;BR /&gt; Jason&lt;BR /&gt; Wee&lt;BR /&gt; ]&lt;SPAN class="s1"&gt;; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a table that shows me all staff and as expression "director" or "non-director" depending on whether it exists in the DIRECTOR table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried =&lt;SPAN class="s1"&gt;If&lt;/SPAN&gt;(&lt;SPAN class="s1"&gt;Match&lt;/SPAN&gt;(&lt;SPAN class="s2"&gt;[Staff Name]&lt;/SPAN&gt;,&lt;SPAN class="s2"&gt;[Director Name]&lt;/SPAN&gt;),'Director','Non-Director')&lt;/P&gt;&lt;P&gt;It works as long as I select something in the Director field. That's not what I want. I want the returned value to be independent from what is selected or not in the DIRECTOR list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 18:34:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635220#M232961</guid>
      <dc:creator />
      <dc:date>2014-05-15T18:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct values of a field as parameter for Match function</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635221#M232962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need an aggregation here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming a chart with dimension [Staff Name], maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= if( sum( match([Director Name], [Staff Name]) ), 'Director', 'Non-Director')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 18:56:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635221#M232962</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2014-05-15T18:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct values of a field as parameter for Match function</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635222#M232963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DIRECTOR:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Director Name&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&amp;nbsp; chr(39) &amp;amp; Concat([Director Name], chr(39) &amp;amp; ',' &amp;amp; chr(39)) &amp;amp; chr(39) as concatfield&lt;/P&gt;&lt;P&gt;resident DIRECTOR;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET var = peek('concatfield');&lt;/P&gt;&lt;P&gt;trace $(var);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STAFF:&lt;/P&gt;&lt;P&gt;load *, if(match([Staff Name], $(var)),1,0) as flag;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Staff Name&lt;/P&gt;&lt;P&gt;Regis&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;Wee&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 19:00:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635222#M232963</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-05-15T19:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct values of a field as parameter for Match function</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635223#M232964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Massimo. I feel it is an over-complicated solution for something that can be done easily in Excel though.&lt;/P&gt;&lt;P&gt;Sometimes I feel complicated things can be done easily in Qlikview but simple things require extensive scripting...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 May 2014 22:45:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635223#M232964</guid>
      <dc:creator />
      <dc:date>2014-05-15T22:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct values of a field as parameter for Match function</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635224#M232965</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;if you would like to do it in script, try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;People:&lt;/P&gt;&lt;P&gt;LOAD *,'Director' as level INLINE [&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *, 'No Director' as level INLINE [&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;P&gt;Regis&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;Wee&lt;/P&gt;&lt;P&gt;] Where not Exists(Name);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 10:53:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635224#M232965</guid>
      <dc:creator />
      <dc:date>2014-05-16T10:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Distinct values of a field as parameter for Match function</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635225#M232966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Another way to achive this, in front-end only, is to use a variable like&lt;/P&gt;&lt;P&gt;vDirector = =concat({1}chr(39)&amp;amp;[Director Name]&amp;amp;chr(39),',')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the use it in expression : If(Match([Staff Name],$(vDirector)),'Director','Non-Director')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the best way is to create a flag using ApplyMap:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DIRECTOR:&lt;/P&gt;&lt;P&gt;Mapping&lt;/P&gt;&lt;P&gt;LOAD [Director Name] as Staff, 'Director' as Position INLINE [&lt;/P&gt;&lt;P&gt;Director Name&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STAFF:&lt;/P&gt;&lt;P&gt;LOAD *, ApplyMap('DIRECTOR',[Staff Name], 'Non-Director') as _flagIsDirector INLINE [&lt;/P&gt;&lt;P&gt;Staff Name&lt;/P&gt;&lt;P&gt;Regis&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;P&gt;Wee&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2014 12:18:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635225#M232966</guid>
      <dc:creator>daveamz</dc:creator>
      <dc:date>2014-05-16T12:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct values of a field as parameter for Match function</title>
      <link>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635226#M232967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Dariusz and David,&lt;/P&gt;&lt;P&gt;I couldn't sleep over this so I tried a bunch of stuff. I found a pretty easy way inspired from SQL and thought I'd share it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;DIRECTOR:&lt;/P&gt;&lt;P class="p1"&gt;LOAD * INLINE [&lt;/P&gt;&lt;P class="p1"&gt;Director Name&lt;/P&gt;&lt;P class="p1"&gt;Jason&lt;/P&gt;&lt;P class="p1"&gt;Chris&lt;/P&gt;&lt;P class="p1"&gt;];&lt;/P&gt;&lt;P class="p2"&gt;&lt;/P&gt;&lt;P class="p1"&gt;STAFF:&lt;/P&gt;&lt;P class="p1"&gt;LOAD *, if(exists([Director Name],[Staff Name]),'Director','Non-Director') As Status INLINE [&lt;/P&gt;&lt;P class="p1"&gt;Staff Name&lt;/P&gt;&lt;P class="p1"&gt;Regis&lt;/P&gt;&lt;P class="p1"&gt;Mark&lt;/P&gt;&lt;P class="p1"&gt;Chris&lt;/P&gt;&lt;P class="p1"&gt;David&lt;/P&gt;&lt;P class="p1"&gt;Jason&lt;/P&gt;&lt;P class="p1"&gt;Wee&lt;/P&gt;&lt;P class="p1"&gt;];&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Works like wonder!&lt;/P&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;Wee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2014 11:46:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Distinct-values-of-a-field-as-parameter-for-Match-function/m-p/635226#M232967</guid>
      <dc:creator />
      <dc:date>2014-05-17T11:46:52Z</dc:date>
    </item>
  </channel>
</rss>

