<?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 Multiple Values for Variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1866872#M71587</link>
    <description>&lt;P&gt;Repost because I wasn't clear enough.&lt;/P&gt;
&lt;P&gt;I'm trying to use multiple values for an variable within an expression and I can't quite get the syntax right.&lt;/P&gt;
&lt;P&gt;I have variable v.Example (obviously I am using proxies as I can't show my details)&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt; Category1 = {"$1"},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Category2 = {"$2"}&amp;gt;}&lt;BR /&gt;Amount)/1000))&lt;/P&gt;
&lt;P&gt;Category1 can take the following values up, down, left, right&lt;/P&gt;
&lt;P&gt;Category2 can take the following values peppermint, topspin, Cthulu -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So within an expression, if I'm looking for say Category1 to be down, and Category2 to be Cthulu, I would now write&lt;/P&gt;
&lt;P&gt;$(v.Example(down, Cthulu))&lt;/P&gt;
&lt;P&gt;I would like to be able to select more than value for each variable in my set expression so for example I would like&lt;/P&gt;
&lt;P&gt;$(v.Example(down, [peppermint, Cthulu]))&lt;/P&gt;
&lt;P&gt;Can someone please help out with the correct syntax?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;</description>
    <pubDate>Mon, 06 Dec 2021 02:58:46 GMT</pubDate>
    <dc:creator>GrantBooth</dc:creator>
    <dc:date>2021-12-06T02:58:46Z</dc:date>
    <item>
      <title>Multiple Values for Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1866872#M71587</link>
      <description>&lt;P&gt;Repost because I wasn't clear enough.&lt;/P&gt;
&lt;P&gt;I'm trying to use multiple values for an variable within an expression and I can't quite get the syntax right.&lt;/P&gt;
&lt;P&gt;I have variable v.Example (obviously I am using proxies as I can't show my details)&lt;/P&gt;
&lt;P&gt;Sum({&amp;lt; Category1 = {"$1"},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Category2 = {"$2"}&amp;gt;}&lt;BR /&gt;Amount)/1000))&lt;/P&gt;
&lt;P&gt;Category1 can take the following values up, down, left, right&lt;/P&gt;
&lt;P&gt;Category2 can take the following values peppermint, topspin, Cthulu -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So within an expression, if I'm looking for say Category1 to be down, and Category2 to be Cthulu, I would now write&lt;/P&gt;
&lt;P&gt;$(v.Example(down, Cthulu))&lt;/P&gt;
&lt;P&gt;I would like to be able to select more than value for each variable in my set expression so for example I would like&lt;/P&gt;
&lt;P&gt;$(v.Example(down, [peppermint, Cthulu]))&lt;/P&gt;
&lt;P&gt;Can someone please help out with the correct syntax?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 02:58:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1866872#M71587</guid>
      <dc:creator>GrantBooth</dc:creator>
      <dc:date>2021-12-06T02:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1869730#M71825</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;community.qlik.com/t5/New-to-Qlik-Sense/Pass-in-value-into-a-variable-for-set-analysis/td-p/1590111&lt;/P&gt;
&lt;P&gt;&amp;amp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Passing-parameters-to-set-analysis-expression-called-by/m-p/965453" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/Passing-parameters-to-set-analysis-expression-called-by/m-p/965453&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;hope this helps you&lt;/P&gt;
&lt;P&gt;Vikas&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 12:07:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1869730#M71825</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2021-12-13T12:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1870074#M71844</link>
      <description>&lt;P&gt;Thank you, I'm really keen to know if there's a simple solution though, is it possible to enter two different parameter values into a variable, and if so how? As a reminder, I'm looking for something like this&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;$(v.Example(down, [peppermint, Cthulu]))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 22:42:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1870074#M71844</guid>
      <dc:creator>GrantBooth</dc:creator>
      <dc:date>2021-12-13T22:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1870175#M71849</link>
      <description>&lt;P&gt;Hey!&lt;/P&gt;
&lt;P&gt;This may work for you:&lt;/P&gt;
&lt;P&gt;So you create a variable like this (the idea will be the same for other categories/dimensions):&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;Sum({&amp;lt;Category2*={$(=CHR(34) &amp;amp; CONCAT(REPLACE('$1',';',CHR(34) &amp;amp; ',' &amp;amp; CHR(34)),',') &amp;amp; CHR(34))}&amp;gt;}Amount)/1000&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;And you call the variable like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;$(v.Example(Cthulu;peppermint))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 14 Dec 2021 08:11:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1870175#M71849</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2021-12-14T08:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1870472#M71869</link>
      <description>&lt;P&gt;Your variable-parameter mustn't have an included comma because the comma is parameter-delimiter and each comma within a $-sign expansion will be treated as a separate parameter. AFAIK there is no way to mask these logic.&lt;/P&gt;
&lt;P&gt;Possible are replace-logics but they could become more complicated as they are helpful. Probably there are very rare scenarios in which it could be practically to implement such approaches.&lt;/P&gt;
&lt;P&gt;Beside this you could apply syntax which doesn't need commas - by multiple values for a field you may specify them as:&lt;/P&gt;
&lt;P&gt;(value1|value2|value3)&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 14 Dec 2021 15:35:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1870472#M71869</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-12-14T15:35:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1871206#M71902</link>
      <description>&lt;P&gt;Thanks, that works perfectly&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 01:50:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1871206#M71902</guid>
      <dc:creator>GrantBooth</dc:creator>
      <dc:date>2021-12-15T01:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1871257#M71904</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;, if i understood correctly:&lt;/P&gt;
&lt;P&gt;Define a variable like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;SUM({&amp;lt;$(=REPLACE('$1;$2;$3;$4;$5;$6',';',','))&amp;gt;}sales)&lt;/LI-CODE&gt;
&lt;P&gt;Call it like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RsQK_0-1639552216797.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68611i94B97AD562372CC4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RsQK_0-1639552216797.png" alt="RsQK_0-1639552216797.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Inside expression editor it looks like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RsQK_1-1639552261043.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68612i53569D78CFBB5F0D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RsQK_1-1639552261043.png" alt="RsQK_1-1639552261043.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Meaning three values were passed as one for the $1.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 07:11:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1871257#M71904</guid>
      <dc:creator>RsQK</dc:creator>
      <dc:date>2021-12-15T07:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1871321#M71906</link>
      <description>&lt;P&gt;Yes, you could do it in this case in this way and it looked here not too complicated. But you need to add an extra logic to resolve your bypass-measures and keeping in mind that you will apply a different value-concat syntax as the Qlik native ones.&lt;/P&gt;
&lt;P&gt;Quite often are the scenarios more complex and the values may contain spaces and/or special chars and/or may contain also this delimiter-char and/or aren't&amp;nbsp; complete values else search-strings. Also the variable-parameter-logic may not only be used to specify values else also for (parts of) fieldnames, multiple conditions, operators/identifiers/modifiers or functions. Further not seldom are the users trying to nest multiple variables.&lt;/P&gt;
&lt;P&gt;In general everything from the above mentioned stuff is technically solvable but the complexity and the efforts to get this all right - beside the comma-topic also the entire quotes-sysntax-stuff - could become extremely high. Therefore my suggestion to keep the things simple and not adding extra logics else switching to comma-avoiding syntaxes and also to consider if the variable-stuff really simplified the life or if it starts to tends to the opposite ...&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 09:22:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Multiple-Values-for-Variable/m-p/1871321#M71906</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-12-15T09:22:08Z</dc:date>
    </item>
  </channel>
</rss>

