<?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: Set analysis with dynamic variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23761#M1612</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2018 12:06:19 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2018-06-14T12:06:19Z</dc:date>
    <item>
      <title>Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23752#M1603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I've been trying to get a set analysis expression working with a variable without any luck.&amp;nbsp; My variable value is set dynamically depending on selection(s) of a dimension.&amp;nbsp; Definition is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(GetSelectedCount(Test_ID)&amp;lt;&amp;gt; 1,('SYP' &amp;amp;&amp;nbsp; ',' &amp;amp; 'RPR'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(MixMatch(GetFieldSelections(Test_ID),'SYP'),('SYP'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(MixMatch(GetFieldSelections(Test_ID),'RPR'),('RPR'),('SYP' &amp;amp;&amp;nbsp; ',' &amp;amp; 'RPR'))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I put this value in a KPI it displays as SYP,RPR but if I use it in a set analysis expression like the following it doesn't apply and shows up as a - in the kpi&lt;/P&gt;&lt;P&gt;=Count({$&amp;lt;Positive = {'Y'},Test_ID={$(=vSYPRPR)}&amp;gt;}[Order#])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I define the variable like the following then the correct values are returned&lt;/P&gt;&lt;P&gt;='SYP,RPR'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it not possible to use a dynamically defined variable in set analysis?&amp;nbsp; I've looked up lots of examples of using variables in set analysis and tried the various examples I've seen on the community but have not been able to get this to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help or insight.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 18:56:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23752#M1603</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2018-06-13T18:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23753#M1604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;If(GetSelectedCount(Test_ID)&amp;lt;&amp;gt; 1, Chr(39) &amp;amp; 'SYP' &amp;amp; Chr(39) &amp;amp;&amp;nbsp; ',' &amp;amp; Chr(39) &amp;amp;&amp;nbsp; 'RPR' &amp;amp; Chr(39),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(MixMatch(GetFieldSelections(Test_ID),'SYP'), Chr(39) &amp;amp; 'SYP' &amp;amp; Chr(39),&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(MixMatch(GetFieldSelections(Test_ID),'RPR'), Chr(39) &amp;amp; 'RPR' &amp;amp; Chr(39), &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Chr(39) &amp;amp; 'SYP' &amp;amp; Chr(39) &amp;amp;&amp;nbsp; ',' &amp;amp; Chr(39) &amp;amp;&amp;nbsp; 'RPR' &amp;amp; Chr(39)&lt;/SPAN&gt;)))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:29:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23753#M1604</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-13T19:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23754#M1605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;Thank you for the reply.&amp;nbsp; When I do that the variable in the KPI looks ok with the quotes around the individual values but in the count expression it doesn't evaluate coming back with a value of -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried something similar by concatenating the quotes and received the same results.&amp;nbsp; &lt;/P&gt;&lt;P&gt;('''SYP''' &amp;amp;&amp;nbsp; ',' &amp;amp; '''RPR''')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wayne&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:37:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23754#M1605</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2018-06-13T19:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23755#M1606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try removing the = from your set analysis and see if that works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count({$&amp;lt;Positive = {'Y'}, Test_ID = {$(vSYPRPR)}&amp;gt;} [Order#])&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:39:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23755#M1606</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-13T19:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23756#M1607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;Unfortunately same result.&amp;nbsp; Here is the changed statement just to verify I didn't do something wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count({$&amp;lt;Positive = {'Y'},Test_ID={$(vSYPCH39)}&amp;gt;}[Order#])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp; Wayne&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:45:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23756#M1607</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2018-06-13T19:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23757#M1608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, just so we are on the same page... you used the new expression I gave for your variable and used the above expression without = sign and still didn't get anything? Would you be able to share a sample to check this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:47:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23757#M1608</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-13T19:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23758#M1609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;No worries.&amp;nbsp; Yes, I created a new variable called &lt;SPAN style="font-size: 13.3333px;"&gt;vSYPCH39 and copied the definition you supplied as follows&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;If(GetSelectedCount(Test_ID)&amp;lt;&amp;gt; 1, Chr(39) &amp;amp; 'SYP' &amp;amp; Chr(39) &amp;amp;&amp;nbsp; ',' &amp;amp; Chr(39) &amp;amp;&amp;nbsp; 'RPR' &amp;amp; Chr(39),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(MixMatch(GetFieldSelections(Test_ID),'SYP'), Chr(39) &amp;amp; 'SYP' &amp;amp; Chr(39),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(MixMatch(GetFieldSelections(Test_ID),'RPR'), Chr(39) &amp;amp; 'RPR' &amp;amp; Chr(39), Chr(39) &amp;amp; 'SYP' &amp;amp; Chr(39) &amp;amp;&amp;nbsp; ',' &amp;amp; Chr(39) &amp;amp;&amp;nbsp; 'RPR' &amp;amp; Chr(39))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the expression is the following:&lt;/P&gt;&lt;P&gt;=Count({$&amp;lt;Positive = {'Y'},Test_ID={$(vSYPCH39)}&amp;gt;}[Order#])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll see if I can get a small app together, it has a lot of data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jun 2018 19:53:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23758#M1609</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2018-06-13T19:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23759#M1610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;I attached an example to my post above.&amp;nbsp; There is a KPI with a value of "-" that is using the variable and expression from the post above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wayne&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 11:48:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23759#M1610</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2018-06-14T11:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23760#M1611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am checking&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 11:50:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23760#M1611</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-14T11:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23761#M1612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 12:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23761#M1612</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-14T12:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23762#M1613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ugh, so somewhere in my cutting and pasting I left an "=" sign in the NUM function.&amp;nbsp; I tried it again with some of my other variables but they still didn't work, so I did need the Chr(39) version which was the real issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for all your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 12:33:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23762#M1613</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2018-06-14T12:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with dynamic variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23763#M1614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also, added = before the variable &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;vSYPCH39&lt;/STRONG&gt;. Removed $() from the KPI variable and removed - sign after Num(...)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2018 12:36:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-dynamic-variable/m-p/23763#M1614</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-14T12:36:53Z</dc:date>
    </item>
  </channel>
</rss>

