<?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: Why storing the expression as string in variable? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831447#M987977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(1)&lt;/P&gt;&lt;P&gt;Chr(39) returns a single quote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=CONCAT(Chr(39)&amp;amp;MyColumn&amp;amp;Chr(39),',')&amp;nbsp;&amp;nbsp; returns an output as&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;'JKL','VWX'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you dont use&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Chr(39), then &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=CONCAT(MyColumn,',')&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;returns an output as&amp;nbsp;&amp;nbsp; JKL,VXX.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So when you want to search a value in a field we enter as Field = 'JKL' .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So the output should be enclosed in&amp;nbsp; single quotes and to get that output&amp;nbsp; with single quote we use chr(39).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(2)&lt;/P&gt;&lt;P&gt;if you are using an expression in multiple places, its easy to store the expression in a variable and use that variable in all those multiple places.&lt;/P&gt;&lt;P&gt;If in need to modify the expression, it can be modified in just one place i.e the expression stored in the variable rather than going to multiple places and changing all the expressions .&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jul 2015 16:04:17 GMT</pubDate>
    <dc:creator>Qrishna</dc:creator>
    <dc:date>2015-07-20T16:04:17Z</dc:date>
    <item>
      <title>Why storing the expression as STRING in variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831446#M987976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was reading a document and came across the below statement. To give the context, i am pasting the whole statement. However I didnt understand the bolded part.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;There are occasions when you want to pass a dynamic selection of values to a set statement. To do this I would need to add some single quotes to the string so that the CONCAT() function returns e.g. 'JKL','VWX'. &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;But you cannot have the single quotes as they are, since they then would be interpreted when the Concat is evaluated instead of when the set expression is evaluated. Instead I use the Chr() function:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;=CONCAT(Chr(39)&amp;amp;MyColumn&amp;amp;Chr(39),',')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I can then pass this concat statement to the inside of an expression…&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;=Sum({&amp;lt;MyColumn={$(=CONCAT(Chr(39)&amp;amp;MyColumn&amp;amp;Chr(39),','))}&amp;gt;} Value)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please explain with a example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also why storing the expression as string in variable?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.63636302948px;"&gt;Eg- LET vGrossSales = 'FIELD={'&amp;amp;Chr(39) &amp;amp; 'Gross Sales' &amp;amp;Chr(39) &amp;amp; '}';&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 15:48:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831446#M987976</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2015-07-20T15:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why storing the expression as string in variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831447#M987977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(1)&lt;/P&gt;&lt;P&gt;Chr(39) returns a single quote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=CONCAT(Chr(39)&amp;amp;MyColumn&amp;amp;Chr(39),',')&amp;nbsp;&amp;nbsp; returns an output as&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;'JKL','VWX'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you dont use&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Chr(39), then &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=CONCAT(MyColumn,',')&amp;nbsp; &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;returns an output as&amp;nbsp;&amp;nbsp; JKL,VXX.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So when you want to search a value in a field we enter as Field = 'JKL' .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;So the output should be enclosed in&amp;nbsp; single quotes and to get that output&amp;nbsp; with single quote we use chr(39).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(2)&lt;/P&gt;&lt;P&gt;if you are using an expression in multiple places, its easy to store the expression in a variable and use that variable in all those multiple places.&lt;/P&gt;&lt;P&gt;If in need to modify the expression, it can be modified in just one place i.e the expression stored in the variable rather than going to multiple places and changing all the expressions .&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 16:04:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831447#M987977</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2015-07-20T16:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Why storing the expression as STRING in variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831448#M987978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Chaitanya!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to know, why chr(39) is used instead of writing the single cotes directly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 16:32:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831448#M987978</guid>
      <dc:creator>surajap123</dc:creator>
      <dc:date>2015-07-20T16:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why storing the expression as STRING in variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831449#M987979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;chr(39) refers to single quotes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set analysis is very tricky ,so this is a work around it &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 16:37:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831449#M987979</guid>
      <dc:creator>swarup_malli</dc:creator>
      <dc:date>2015-07-20T16:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why storing the expression as STRING in variable?</title>
      <link>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831450#M987980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the expression, &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;CONCAT(Chr(39)&amp;amp;MyColumn&amp;amp;Chr(39),',')&amp;nbsp;&amp;nbsp;&amp;nbsp; , if you use single quote instead of CHR(39) the concat function treates 'MyColumn' as a value but&amp;nbsp; when you write expression as &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;CONCAT(Chr(39)&amp;amp;MyColumn&amp;amp;Chr(39),',') , the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333330154419px;"&gt;MyColumn&lt;/SPAN&gt;is treated as a field inside the expression.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="93382" alt="Capture1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/93382_Capture1.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture2.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/93389_Capture2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture3.PNG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/93390_Capture3.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jul 2015 16:43:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Why-storing-the-expression-as-STRING-in-variable/m-p/831450#M987980</guid>
      <dc:creator>Qrishna</dc:creator>
      <dc:date>2015-07-20T16:43:22Z</dc:date>
    </item>
  </channel>
</rss>

