<?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 Expression Using Variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781502#M1297027</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;In the script side, a&lt;/SPAN&gt;s Qlikview tries to interpret some of the non-alphanumeric characters like $ ' #, as a function, a workaround would be typing these characters' Ascii code in 'chr(XX)' (where XX Ascii code) format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if you try following in your script it will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;LET vIn2010 = SUM({$&amp;lt;YearDate={2010}&amp;gt;} ClientNumber) &lt;/SPAN&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; line-height: 1.5em;"&gt;// I assumed YearDate is a Date field and removed the single quotes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this:&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;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;LET vIn2010 = '&lt;/SPAN&gt;SUM({' &amp;amp; chr(36) &amp;amp; '&amp;lt;YearDate={2010}&amp;gt;} ClientNumber)';&lt;/SPAN&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ansi Codes of frequently used non-alphanumeric chars:&lt;/P&gt;&lt;P&gt;34 "&lt;/P&gt;&lt;P&gt;35 #&lt;/P&gt;&lt;P&gt;36 $&lt;/P&gt;&lt;P&gt;39 '&lt;/P&gt;&lt;P&gt;42 *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Omer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Mar 2015 15:20:53 GMT</pubDate>
    <dc:creator>omerfaruk</dc:creator>
    <dc:date>2015-03-03T15:20:53Z</dc:date>
    <item>
      <title>Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781494#M1297015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys. I have a question (or two) regarding to variables behaviour on Qlikview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two variables with max year and max month from a dates set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I declared the variables on the script with SET and LET (trying to figure it out why it doesn't work), I have the declaration like this:&lt;/P&gt;&lt;P&gt;SET vMaxYear='Max(YearFromDate)';&lt;/P&gt;&lt;P&gt;SET vMaxYear='&lt;STRONG&gt;=&lt;/STRONG&gt;Max(YearFromDate)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using vMaxYear in a set analysis expression like: SUM({$&amp;lt;Year={$(=vMaxYear)}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried with the equal (in definition, and in the set analysis), without it and have no luck. Strange enough, I defined the variable through Variable Overview window and that way it worked but I think that script it's better place (for reuse and so) to define variables not Variable Overview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can attach some example file if you need to, can you point me in the right direction here? I see documentation incomplete in this aspect as it only says SET stores expressions without evaluating them, LET stores values from evaluated expressions (in my understanding)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781494#M1297015</guid>
      <dc:creator />
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781495#M1297017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this syntax on the variable in the SET {'($(vMaxYear))'}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(({$&amp;lt;Year={'($(vMaxYear))'}&amp;gt;}Sales&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 22:01:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781495#M1297017</guid>
      <dc:creator>NickHoff</dc:creator>
      <dc:date>2015-02-10T22:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781496#M1297019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, I already tried that and make no difference, the only way it works is with the variable defined through variable overview. Do you know if Qlikview has any limitation regarding variable complexity in script or so? I don't find variable overview like the way to go having reuse and order in mind&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 22:25:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781496#M1297019</guid>
      <dc:creator />
      <dc:date>2015-02-10T22:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781497#M1297021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cristian,&lt;/P&gt;&lt;P&gt;Can you remove the quation marks&lt;/P&gt;&lt;P&gt;SET vMaxYear=Max(YearFromDate);&lt;/P&gt;&lt;P&gt;SET vMaxYear=Max(YearFromDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see if it works&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 22:30:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781497#M1297021</guid>
      <dc:creator>saurabh5</dc:creator>
      <dc:date>2015-02-10T22:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781498#M1297023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you defined vMaxYear in your Load Script, then what is the value of vMaxYear after the next reload?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 08:55:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781498#M1297023</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-02-11T08:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781499#M1297024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok guys, I tried your suggestions and have no luck so far&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I make this attached qvw to show you the problems I have in a basic scenario. If the attached qvd doesn't work, refer to the qvs file that have the inline tables used. The expressions I tried are:&lt;/P&gt;&lt;P&gt;- SUM({$&amp;lt;YearDate={'2010'}&amp;gt;} ClientNumber) =&amp;gt; WORKS (Returns 3500)&lt;/P&gt;&lt;P&gt;- SUM({$&amp;lt;YearDate={'2010'}, MonthDate={'Jun'}&amp;gt;} ClientNumber) =&amp;gt; WORKS (Returns 800)&lt;/P&gt;&lt;P&gt;- SUM({$&amp;lt;YearDate={$(vMaxYear)}&amp;gt;} ClientNumber) =&amp;gt; Error: Error in set modifier ad hoc element list: ',' or ')' expected&lt;/P&gt;&lt;P&gt;- SUM({$&amp;lt;YearDate={$(vMaxYear)}, MonthDate={$(vMaxMonth)}&amp;gt;} ClientNumber) =&amp;gt; Error: Error in set modifier ad hoc element list: ',' or ')' expected&lt;/P&gt;&lt;P&gt;- SUM({$&amp;lt;YearDate={'($(vMaxYear))'}&amp;gt;} ClientNumber) =&amp;gt; WORKS (Returns 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Variable without quotes&lt;/P&gt;&lt;P&gt;- SUM({$&amp;lt;YearDate={$(vMaxYearWQ)}&amp;gt;} ClientNumber) =&amp;gt; Error: Error in set modifier ad hoc element list: ',' or ')' expected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your answers guys&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 14:16:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781499#M1297024</guid>
      <dc:creator />
      <dc:date>2015-02-11T14:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781500#M1297025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your best approach would be to keep the expressions in a Excel file, load them as a table into QlikView and then use to peek() function to declare your variables. ' causes an issue when you are using LET.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 14:30:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781500#M1297025</guid>
      <dc:creator>simondachstr</dc:creator>
      <dc:date>2015-02-11T14:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781501#M1297026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Cristian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMaxYearL2='=Max(YearDate)';&lt;/P&gt;&lt;P&gt;LET vMaxMonthL2='=Max(MonthDate)';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 18:49:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781501#M1297026</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-11T18:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Expression Using Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781502#M1297027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;In the script side, a&lt;/SPAN&gt;s Qlikview tries to interpret some of the non-alphanumeric characters like $ ' #, as a function, a workaround would be typing these characters' Ascii code in 'chr(XX)' (where XX Ascii code) format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if you try following in your script it will work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;LET vIn2010 = SUM({$&amp;lt;YearDate={2010}&amp;gt;} ClientNumber) &lt;/SPAN&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; line-height: 1.5em;"&gt;// I assumed YearDate is a Date field and removed the single quotes&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this:&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;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;LET vIn2010 = '&lt;/SPAN&gt;SUM({' &amp;amp; chr(36) &amp;amp; '&amp;lt;YearDate={2010}&amp;gt;} ClientNumber)';&lt;/SPAN&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;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Ansi Codes of frequently used non-alphanumeric chars:&lt;/P&gt;&lt;P&gt;34 "&lt;/P&gt;&lt;P&gt;35 #&lt;/P&gt;&lt;P&gt;36 $&lt;/P&gt;&lt;P&gt;39 '&lt;/P&gt;&lt;P&gt;42 *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Omer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2015 15:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Expression-Using-Variables/m-p/781502#M1297027</guid>
      <dc:creator>omerfaruk</dc:creator>
      <dc:date>2015-03-03T15:20:53Z</dc:date>
    </item>
  </channel>
</rss>

