<?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: Expressions as variables. Error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1546997#M746073</link>
    <description>&lt;P&gt;the problem is the single quote which tells the script that it is at the start or the end of a piece of text, so you need to swap that for a chr() reference such as:&lt;/P&gt;&lt;P&gt;VariableName = 'Sum({$&amp;lt;DistributionID={' &amp;amp; chr(39) &amp;amp; '143.3 etc etc etc&lt;/P&gt;&lt;P&gt;It can become quite long winded doing this in the script, but its the only way I've found to make it work.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Feb 2019 15:30:48 GMT</pubDate>
    <dc:creator>NW1965</dc:creator>
    <dc:date>2019-02-20T15:30:48Z</dc:date>
    <item>
      <title>Expressions as variables. Error</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1546992#M746071</link>
      <description>&lt;P&gt;Hello dear, I leave the following query&lt;/P&gt;&lt;P&gt;Why when I add an expression as a variable in the script, does it give me an error and if I do it from the variable panel is it ok?&lt;BR /&gt;The inconvenience I have with the expressions that contain set analysis, is it possible to do it?&lt;/P&gt;&lt;P&gt;Issue:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Expression as Variable.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6434iB057481FEB5057AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Expression as Variable.png" alt="Expression as Variable.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Expression as Variable 2.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/6435i56F97B71F21CE85D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Expression as Variable 2.png" alt="Expression as Variable 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any suggestion?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1546992#M746071</guid>
      <dc:creator>tincholiver</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions as variables. Error</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1546996#M746072</link>
      <description>&lt;P&gt;It would help if you posted the part of the script that generated that. Most of use can't mind-read qlikview documents on other peoples computers.&lt;BR /&gt;What is going wrong are the single quotes. You need to either escape using double single quotes or chr(39) or another placeholder character that you later replace with the single quote&lt;/P&gt;&lt;P&gt;SET vMyVar = sum({&amp;lt;B={&amp;nbsp;@C@ }&amp;gt;} A);&lt;BR /&gt;LET vMyVar = Replace($(vMyVar), '@', chr(39));&lt;/P&gt;&lt;P&gt;But you're not done yet because $(...something...) will be evaluated in the script too and you don't want that. So you can use the replace trick again&lt;/P&gt;&lt;P&gt;LET vMyVar = 'sum({&amp;lt;B={&amp;nbsp;@C@ }, D={"&amp;lt;=%(=max(E))"}&amp;gt;} A)';&lt;BR /&gt;LET vMyVar = Replace(Replace($(vMyVar), '@', chr(39)),'%','$');&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 16:11:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1546996#M746072</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2019-02-20T16:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions as variables. Error</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1546997#M746073</link>
      <description>&lt;P&gt;the problem is the single quote which tells the script that it is at the start or the end of a piece of text, so you need to swap that for a chr() reference such as:&lt;/P&gt;&lt;P&gt;VariableName = 'Sum({$&amp;lt;DistributionID={' &amp;amp; chr(39) &amp;amp; '143.3 etc etc etc&lt;/P&gt;&lt;P&gt;It can become quite long winded doing this in the script, but its the only way I've found to make it work.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 15:30:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1546997#M746073</guid>
      <dc:creator>NW1965</dc:creator>
      <dc:date>2019-02-20T15:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions as variables. Error</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1547004#M746074</link>
      <description>here it's how i load the variable in the script:&lt;BR /&gt;&lt;BR /&gt;LET vEMAES ='sum({&amp;lt;distribucion_id={'143.3'},Concepto={'Variac. Anual'},FECHA={'&amp;gt;=$(=AddMonths(Max({&amp;lt;distribucion_id={143.3}&amp;gt;} FECHA),-24))'} &amp;gt;}Valores)';</description>
      <pubDate>Wed, 20 Feb 2019 15:55:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1547004#M746074</guid>
      <dc:creator>tincholiver</dc:creator>
      <dc:date>2019-02-20T15:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Expressions as variables. Error</title>
      <link>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1547025#M746075</link>
      <description>&lt;P&gt;I found an interesting solution:&lt;BR /&gt;with this script you can load expressions from excel, since there are no problems with single quotes, it is also much easier to administer&lt;/P&gt;&lt;P&gt;Variable Table:&lt;BR /&gt;LOAD Variable,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Expression&lt;BR /&gt;DESDE&lt;BR /&gt;[C: \ Nube \ Wicham \ EQonomia \ Variables.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;let CantVariables = NoOfRows ('Variable Table');&lt;BR /&gt;for i = 0 to (CantVariables-1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let vVariable = Peek ('Variable', i, 'TableVariables');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; let $ (vVariable) = Peek ('Expression', i, 'TableVariables');&lt;BR /&gt;NEXT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks both!&lt;/P&gt;</description>
      <pubDate>Wed, 20 Feb 2019 16:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expressions-as-variables-Error/m-p/1547025#M746075</guid>
      <dc:creator>tincholiver</dc:creator>
      <dc:date>2019-02-20T16:46:16Z</dc:date>
    </item>
  </channel>
</rss>

