<?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: Store set analysis expression in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384835#M491424</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try to replace the double quotes inside your expresion with chr(34), the same value in the ascii table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Nov 2012 13:16:20 GMT</pubDate>
    <dc:creator>anguila</dc:creator>
    <dc:date>2012-11-30T13:16:20Z</dc:date>
    <item>
      <title>Store set analysis expression in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384830#M491419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want to store and if statement expresion (containing set analysis) into a variable in the script for the future usage in expressions in some charts.&lt;/P&gt;&lt;P&gt;As the expression is the same in many charts is better having the same expresion in a variable for its future modifications.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already defined that variable in the trigger section when the script finishes its reload. But for some reasons (developement flexibility, user scalability, all params together, etc..) I have to move into the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question exactly is: "How can I set a variable with this expresion in the script?":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =if(Customer='Custom1',Only({1&amp;lt;IdField={TYPE1'}&amp;gt;} Method), Only({1&amp;lt;IdField={'TYPE2'}&amp;gt;} Method))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried let with no luck..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 09:57:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384830#M491419</guid>
      <dc:creator>anguila</dc:creator>
      <dc:date>2012-09-06T09:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Store set analysis expression in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384831#M491420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try SET vExpre = 'if(Customer='Custom1',Only({1&amp;lt;IdField={TYPE1'}&amp;gt;} Method), Only({1&amp;lt;IdField={'TYPE2'}&amp;gt;} Method))';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET vExpre = '=if(Customer='Custom1',Only({1&amp;lt;IdField={TYPE1'}&amp;gt;} Method), Only({1&amp;lt;IdField={'TYPE2'}&amp;gt;} Method))';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I tried the first variant and it works for a simple expression as field1+field2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 10:05:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384831#M491420</guid>
      <dc:creator>daveamz</dc:creator>
      <dc:date>2012-09-06T10:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Store set analysis expression in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384832#M491421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It doesn't work at all..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I set the expression of a text object as: =&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;vExpre the result is &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;'if(Customer='Custom1',Only({1&amp;lt;IdField={TYPE1'}&amp;gt;} Method), Only({1&amp;lt;IdField={'TYPE2'}&amp;gt;} Method))'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;And when I try to access the value (expresion: =$(vExpre) the result is -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;When I added this expression as a trigger or even as a variable, and I set the expresion of the text object as =vExpre, the result is the expresion WITHOUT quotes: &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;if(Customer='Custom1',Only({1&amp;lt;IdField={TYPE1'}&amp;gt;} Method), Only({1&amp;lt;IdField={'TYPE2'}&amp;gt;} Method))&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;Any idea? I tried the both ways you said (with and without the equal).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-size: 12px; background-color: #ffffff; font-family: Arial;"&gt;Thanks for the reply!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 16:17:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384832#M491421</guid>
      <dc:creator>anguila</dc:creator>
      <dc:date>2012-09-06T16:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Store set analysis expression in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384833#M491422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I solved it! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem was so silly.. the issue was with the single quotes of the set analysis, so I just surrounded it the expression with double quotes and it worked like a charm:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;SET vExpre = "if(Customer='Custom1',Only({1&amp;lt;IdField={TYPE1'}&amp;gt;} Method), Only({1&amp;lt;IdField={'TYPE2'}&amp;gt;} Method))";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #ffffff;"&gt;David.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Sep 2012 19:52:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384833#M491422</guid>
      <dc:creator>anguila</dc:creator>
      <dc:date>2012-09-06T19:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Store set analysis expression in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384834#M491423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a similar problem only that my expression uses both ' and ", any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;num((1 - (sum({&amp;lt;DATUM={"&amp;gt;=$(v7daysBack)&amp;lt;=$(v1dayBack)"}&amp;gt;}_Brist) / (sum({&amp;lt;DATUM={"&amp;gt;=$(v7daysBack)&amp;lt;=$(v1dayBack)"}&amp;gt;}_Brist)+sum({&amp;lt;DATUM={"&amp;gt;=$(v7daysBack)&amp;lt;=$(v1dayBack)"}&amp;gt;}_EJ_Brist))))*100,'##,0', ',')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2012 12:47:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384834#M491423</guid>
      <dc:creator>marcelo_7</dc:creator>
      <dc:date>2012-11-30T12:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Store set analysis expression in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384835#M491424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try to replace the double quotes inside your expresion with chr(34), the same value in the ascii table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2012 13:16:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Store-set-analysis-expression-in-the-script/m-p/384835#M491424</guid>
      <dc:creator>anguila</dc:creator>
      <dc:date>2012-11-30T13:16:20Z</dc:date>
    </item>
  </channel>
</rss>

