<?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: Expression dependent on which tables fields' are filtered in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-dependent-on-which-tables-fields-are-filtered/m-p/1346958#M414424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lost part of the Option 2 expression. It should be:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; sum( {&amp;lt; [$Table] =- {'FIRST_TABLE_TO_IGNORE','SECOND_TABLE_TO_IGNORE'}&amp;gt;} GetSelectedCount($Field)&amp;nbsp; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 May 2017 18:15:09 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-05-26T18:15:09Z</dc:date>
    <item>
      <title>Expression dependent on which tables fields' are filtered</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-dependent-on-which-tables-fields-are-filtered/m-p/1346957#M414423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been pondering this and exploring it for several days without quite figuring it out, and after pretty extensive exploration of the forums, I haven't yet found a clean solution, so I'm hoping y'all can help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In an expression, I want to do one calculation if there are filters applied to any of the 145 fields that make up three of my tables (the fact and two of the dimensions).&amp;nbsp; I want a different calculation if there are not any filters on those fields (but there might be filters using fields in the remaining two tables).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've basically narrowed it down to two promising approaches, neither of which I can quite make work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 1: Do my conditional switch between the two calculations based on wildmatching the Current Selections to the Field Names in the tables I care about.&amp;nbsp; Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wildmatch(GetCurrentSelections(), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; concat({&amp;lt; [$Table] =- {'FIRST_TABLE_TO_IGNORE','SECOND_TABLE_TO_IGNORE'}&amp;gt;} chr(39) &amp;amp; '*' &amp;amp; $Field &amp;amp; '*' &amp;amp; chr(39) ,','))&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the GetCurrentSelections() and the concat statement seem to give what I would expect to work, and a baby example works fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wildmatch(GetCurrentSelections(),'*State*','*Status*','*Attribute*')&amp;nbsp; // works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the overall wildmatch expression with the set analysis to get the fields does not work.&amp;nbsp; Is there a limitation on the number or length of the expressions to which wildmatch can compare?&amp;nbsp; My concat string is 2824 characters long with 145 expressions (field names) to test against.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Option 2:&amp;nbsp; Somehow do a Get Selected Count on all the fields I care about and add them up and see if it's greater than 0.&amp;nbsp; Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( &lt;SPAN style="font-size: 13.3333px;"&gt;{'FIRST_TABLE_TO_IGNORE','SECOND_TABLE_TO_IGNORE'}&amp;gt;}&lt;/SPAN&gt; GetSelectedCount($Field)&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with this seems to be that GetSelectedCount generally can't accept more than one field name at a time, or even the $Field system field in general. This is the closest prior attempt at this that I found:&amp;nbsp; &lt;A href="https://community.qlik.com/thread/173249"&gt;Getselectedcount in multiple fields&lt;/A&gt; and it relies on the fields having similarly structured names; I'd rather not rename all my fields just to enable this one calculation to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there maybe some way to loop through all the $Field values in the set I want -- maybe something macro'y?&amp;nbsp; (Haven't played with the macros much yet...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any advice you can give me on making either of these approaches work, or suggesting an option I haven't come up with yet&lt;SPAN style="font-size: 10pt;"&gt;!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Emily&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 17:57:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-dependent-on-which-tables-fields-are-filtered/m-p/1346957#M414423</guid>
      <dc:creator />
      <dc:date>2017-05-26T17:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression dependent on which tables fields' are filtered</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-dependent-on-which-tables-fields-are-filtered/m-p/1346958#M414424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lost part of the Option 2 expression. It should be:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; sum( {&amp;lt; [$Table] =- {'FIRST_TABLE_TO_IGNORE','SECOND_TABLE_TO_IGNORE'}&amp;gt;} GetSelectedCount($Field)&amp;nbsp; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 18:15:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-dependent-on-which-tables-fields-are-filtered/m-p/1346958#M414424</guid>
      <dc:creator />
      <dc:date>2017-05-26T18:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Expression dependent on which tables fields' are filtered</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-dependent-on-which-tables-fields-are-filtered/m-p/1346959#M414425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update - I think I've gotten a variant on Option 1 to work.&amp;nbsp; The concat wasn't expanding properly within the wildmatch, I think.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp; Wildmatch(GetCurrentSelections(), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; $(=concat({&amp;lt; [$Table] =- {'&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FIRST_TABLE_TO_IGNORE','SECOND_TABLE_TO_IGNORE&lt;/SPAN&gt;'}&amp;gt;} chr(39) &amp;amp; '*' &amp;amp; $Field &amp;amp; '*' &amp;amp; chr(39) ,',')) )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2017 19:28:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-dependent-on-which-tables-fields-are-filtered/m-p/1346959#M414425</guid>
      <dc:creator />
      <dc:date>2017-05-26T19:28:28Z</dc:date>
    </item>
  </channel>
</rss>

