<?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 Using concat to create a dynamic set modifier in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348391#M414773</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the concat function we assemble a set modifier to use in an expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concat( DISTINCT TOTAL &amp;lt;Group&amp;gt; Chr(39) &amp;amp; Key &amp;amp; Chr(39) , chr(44))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when putting this in an expression: this results nicely in following strings depending on &lt;SPAN style="font-size: 13.3333px;"&gt;the dimension value of the row in the table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 169px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;'2','3'&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;'1','2','3'&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;'2'&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We then want to use this in a set analysis in order to make the set modifier depend on the dimension value of the row in the table.&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Key2={$(=Concat( DISTINCT TOTAL &amp;lt;Group&amp;gt; Chr(39) &amp;amp; Key &amp;amp; Chr(39) , chr(44)))}&amp;gt;}Data)&lt;/P&gt;&lt;P&gt;However it seems the set analysis use '1','2','3' as set modifier for each row, regardless of the dimension value of the row in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried to work through a variable (put to concat formula in vKeysInGroup) but that gave the same result.&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Key2={$(=$(vKeysInGroup))}&amp;gt;}Data)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to solve this? Refer to a simple test app attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Apr 2017 09:10:41 GMT</pubDate>
    <dc:creator>wdonckers</dc:creator>
    <dc:date>2017-04-20T09:10:41Z</dc:date>
    <item>
      <title>Using concat to create a dynamic set modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348391#M414773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using the concat function we assemble a set modifier to use in an expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concat( DISTINCT TOTAL &amp;lt;Group&amp;gt; Chr(39) &amp;amp; Key &amp;amp; Chr(39) , chr(44))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when putting this in an expression: this results nicely in following strings depending on &lt;SPAN style="font-size: 13.3333px;"&gt;the dimension value of the row in the table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 169px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;'2','3'&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;'1','2','3'&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;'2'&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We then want to use this in a set analysis in order to make the set modifier depend on the dimension value of the row in the table.&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Key2={$(=Concat( DISTINCT TOTAL &amp;lt;Group&amp;gt; Chr(39) &amp;amp; Key &amp;amp; Chr(39) , chr(44)))}&amp;gt;}Data)&lt;/P&gt;&lt;P&gt;However it seems the set analysis use '1','2','3' as set modifier for each row, regardless of the dimension value of the row in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried to work through a variable (put to concat formula in vKeysInGroup) but that gave the same result.&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Key2={$(=$(vKeysInGroup))}&amp;gt;}Data)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to solve this? Refer to a simple test app attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 09:10:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348391#M414773</guid>
      <dc:creator>wdonckers</dc:creator>
      <dc:date>2017-04-20T09:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using concat to create a dynamic set modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348392#M414774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;try&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;sum({&amp;lt;Key2=P(Key) &amp;gt;} Data)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you use set analysis like this, the calculation will be dimensionless.&lt;/P&gt;&lt;P&gt;Could be that you have to use ifs without set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 09:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348392#M414774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-20T09:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using concat to create a dynamic set modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348393#M414775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tried that using an if and a substringcount I could solve this as long as I have Key2 as dimension in the table. If not, because i just want to show totals by Group then it does not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 09:38:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348393#M414775</guid>
      <dc:creator>wdonckers</dc:creator>
      <dc:date>2017-04-20T09:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using concat to create a dynamic set modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348394#M414776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set analysis as well as a dollar sign expansion are evaluated once per chart, not per dimensional row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the 'classic' discussion:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-1335"&gt;Evaluating "sets" in the context of a dimension&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 09:48:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348394#M414776</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-04-20T09:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using concat to create a dynamic set modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348395#M414777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if Key is in the same table as Key2 as it is in your attachment, then&lt;/P&gt;&lt;P&gt;you could use a flag:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;if (Key1=Key2,1) as FLAG;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you select the flag in set analysis:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;FLAG={"1"}&amp;gt;} Data)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if Key and Key 2 are in different tables you could use aggr() or a simple expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(if(Key1=Key2,Data)&lt;/P&gt;&lt;P&gt;--&amp;gt; this will sum up row by row even if you don't have Key2 as dimenssion in the table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 09:48:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348395#M414777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-20T09:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using concat to create a dynamic set modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348396#M414778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In reality I would have about 7000 groups in my application.&lt;/P&gt;&lt;P&gt;That would then mean an if statement with a 7000-fold nested if statement or alternatively the definition of 7000 variables?&lt;/P&gt;&lt;P&gt;That doesn't seem to be a good workaround, does it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other workaround you can think of?&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;Wim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 11:57:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348396#M414778</guid>
      <dc:creator>wdonckers</dc:creator>
      <dc:date>2017-04-20T11:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using concat to create a dynamic set modifier</title>
      <link>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348397#M414779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;join everything needed for a flag into one table...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 12:00:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-concat-to-create-a-dynamic-set-modifier/m-p/1348397#M414779</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-20T12:00:26Z</dc:date>
    </item>
  </channel>
</rss>

