<?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: Variable Arguments containing comma in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924431#M319969</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The MapSubstring method works fine in the attached example. I think you just had to many test variables going and were referencing the wrong one in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the quote issue, use the escape syntax for single-quotes, which is to type the single-quote twice.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(vExpr(year={''2014''};month={''11''}))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is shown in the example as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;SPAN&gt; !&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Nov 2015 18:10:57 GMT</pubDate>
    <dc:creator>rwunderlich</dc:creator>
    <dc:date>2015-11-19T18:10:57Z</dc:date>
    <item>
      <title>Variable Arguments containing comma</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924428#M319966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are trying to centralize all the calculations used in dashboard via variables containing expressions. These variable definition will be stored in external file.&amp;nbsp; However, we have run into problem that if a variable argument contains comma, qlikview treats it as next argument. I've researched a bit and found people have given a workaround, to use a different character like ;&amp;nbsp; instead of , and use replace in variable definition to replace semi colon with comma. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;A href="https://community.qlik.com/docs/DOC-2945"&gt;Comma problem (,) workaround for dollar sign expansion with parameters&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;A href="http://bi-review.blogspot.com/2012/05/how-to-write-reusable-and-expandable.html" title="http://bi-review.blogspot.com/2012/05/how-to-write-reusable-and-expandable.html"&gt;BI Review: How to write reusable and expandable expressions in QlikView&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, this solution is not working for me. When i try to implement it, if I use SET in variable definition, the $ expansion of replace gives out null. If I use LET, then I get script error. If i use LET and put expression in single quotes, similar behavior as SET happens.&amp;nbsp; The only way, I could implement it is if I put the variable definition in front end, however I can't go that way, since we are moving definition to external file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally this solution should have worked as per above links. Can anybody look at my sample code and tell me what I'm doing wrong. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help Appreciated &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 15:44:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924428#M319966</guid>
      <dc:creator>abe786</dc:creator>
      <dc:date>2015-11-17T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Arguments containing comma</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924429#M319967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dealing with literal $ and quotes in LET/SET can be a pain. I use proxy characters (@ for $, | for ') and replace them with MapSubstring. It's flexible and handles any number of special characters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;EscapeCharsMap:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MAPPING LOAD * INLINE [&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;from, to&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;@,$&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;|,'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LET vExpr = MapSubString('EscapeCharsMap',&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;'SUM({@&amp;lt; @(=Replace($1, |;|, |,|)) &amp;gt;} quantity)'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, you shouldn't quote $1 if you are passing it quoted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can avoid this issue altogether by storing the variables in an external file and using peek() to populate the variable. No interpretation will be done by peek. See&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.qlikfix.com/2011/09/21/storing-variables-outside-of-qlikview/" title="http://www.qlikfix.com/2011/09/21/storing-variables-outside-of-qlikview/"&gt;Storing variables outside of QlikView - The Qlik Fix! The Qlik Fix!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com/" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com/" rel="nofollow"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2015 16:22:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924429#M319967</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-11-17T16:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Arguments containing comma</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924430#M319968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much @Rob for taking the time to reply &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;However, the mapsubstring method is not working for me. See attached qvw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to work it via peek method from the link you had shared. However, there is a issue if the passed variable contains a single quote, then it doesn't work. For e.g. for&lt;/P&gt;&lt;P&gt;vExpr defined as SUM({&amp;lt;$(=Replace($1, ';', ','))&amp;gt;} quantity) in Excel sheet, this works&lt;/P&gt;&lt;P&gt;=$(vExpr('year={2014};month={11}')) in expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, below doesn't work:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;=$(vExpr('year={'2014'};month={'11'}'))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;In my project, i have to pass non-numeric set conditions, so unable to work it out &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Any suggestions?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 15:09:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924430#M319968</guid>
      <dc:creator>abe786</dc:creator>
      <dc:date>2015-11-19T15:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variable Arguments containing comma</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924431#M319969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The MapSubstring method works fine in the attached example. I think you just had to many test variables going and were referencing the wrong one in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the quote issue, use the escape syntax for single-quotes, which is to type the single-quote twice.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(vExpr(year={''2014''};month={''11''}))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is shown in the example as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://masterssummit.com" rel="nofollow"&gt;http://masterssummit.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://qlikviewcookbook.com" rel="nofollow"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;SPAN&gt; !&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Nov 2015 18:10:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-Arguments-containing-comma/m-p/924431#M319969</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2015-11-19T18:10:57Z</dc:date>
    </item>
  </channel>
</rss>

