<?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 Variable as expression in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647686#M237169</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help me to use variable as code fragment in script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using next config file with content:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCycleString = null;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFullReload&amp;nbsp; = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SWITCH vFullReload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CASE '0' //----------0 - incremental reload&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYear_Beg_ = Year(Div(Num(MonthEnd(Now(1))),1))-4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYear_End_ = Year(Div(Num(MonthEnd(Now(1))),1));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYearMonth_Beg = Year(vStartDocDate)*100+Month(vStartDocDate);&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYearMonth_End = Year(vEndDocDate)*100+Month(vEndDocDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCycleString = 'IF vYM &amp;gt;= vYearMonth_Beg and vYM &amp;lt;= vYearMonth_End then';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CASE '1' //----------full reload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYear_Beg_ =2013;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYear_End_ =2014;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYearMonth_Beg_ =vYear_Beg_*100+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYearMonth_End_ =vYear_End_*100+12;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCycleString = 'IF vYM &amp;gt;= vYearMonth_Beg_ and vYM &amp;lt;= vYearMonth_End_ then';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSWITCH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I want to use variable &lt;SPAN style="font-size: 13.63636302948px;"&gt;vFullReload to get one condition from two cases. With variables(&lt;SPAN style="font-size: 13.63636302948px;"&gt;vYear_Beg_,&lt;SPAN style="font-size: 13.63636302948px;"&gt;vYear_End_,&lt;SPAN style="font-size: 13.63636302948px;"&gt;vYearMonth_Beg_,&lt;SPAN style="font-size: 13.63636302948px;"&gt;vYearMonth_End_&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;) is all ok. But the variable&amp;nbsp; &lt;SPAN style="font-size: 13.63636302948px;"&gt;vCycleString looks like some peace of script. I need to use that variable in script.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;But when i'm coding something like $(&lt;SPAN style="font-size: 13.63636302948px;"&gt;vCycleString&lt;/SPAN&gt;) in script - QlikView doesn't want to interpret as a line of a code.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Sep 2014 11:36:14 GMT</pubDate>
    <dc:creator>lylererger</dc:creator>
    <dc:date>2014-09-19T11:36:14Z</dc:date>
    <item>
      <title>Variable as expression in script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647686#M237169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help me to use variable as code fragment in script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using next config file with content:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCycleString = null;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFullReload&amp;nbsp; = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SWITCH vFullReload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; CASE '0' //----------0 - incremental reload&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYear_Beg_ = Year(Div(Num(MonthEnd(Now(1))),1))-4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYear_End_ = Year(Div(Num(MonthEnd(Now(1))),1));&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYearMonth_Beg = Year(vStartDocDate)*100+Month(vStartDocDate);&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYearMonth_End = Year(vEndDocDate)*100+Month(vEndDocDate);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCycleString = 'IF vYM &amp;gt;= vYearMonth_Beg and vYM &amp;lt;= vYearMonth_End then';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; CASE '1' //----------full reload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYear_Beg_ =2013;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYear_End_ =2014;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYearMonth_Beg_ =vYear_Beg_*100+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vYearMonth_End_ =vYear_End_*100+12;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCycleString = 'IF vYM &amp;gt;= vYearMonth_Beg_ and vYM &amp;lt;= vYearMonth_End_ then';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSWITCH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I want to use variable &lt;SPAN style="font-size: 13.63636302948px;"&gt;vFullReload to get one condition from two cases. With variables(&lt;SPAN style="font-size: 13.63636302948px;"&gt;vYear_Beg_,&lt;SPAN style="font-size: 13.63636302948px;"&gt;vYear_End_,&lt;SPAN style="font-size: 13.63636302948px;"&gt;vYearMonth_Beg_,&lt;SPAN style="font-size: 13.63636302948px;"&gt;vYearMonth_End_&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;) is all ok. But the variable&amp;nbsp; &lt;SPAN style="font-size: 13.63636302948px;"&gt;vCycleString looks like some peace of script. I need to use that variable in script.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;But when i'm coding something like $(&lt;SPAN style="font-size: 13.63636302948px;"&gt;vCycleString&lt;/SPAN&gt;) in script - QlikView doesn't want to interpret as a line of a code.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 11:36:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647686#M237169</guid>
      <dc:creator>lylererger</dc:creator>
      <dc:date>2014-09-19T11:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Variable as expression in script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647687#M237170</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;Have you tried looking at the difference between LET and SET statements? There are helpful examples in the help &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use the SET statement with no quotes, otherwise QV will try and evaluate it straight away in the LET.&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;"&gt;SET vCycleString = IF vYM &amp;gt;= vYearMonth_Beg_ and vYM &amp;lt;= vYearMonth_End_ then;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Does this work?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; 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-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Erica&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 11:47:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647687#M237170</guid>
      <dc:creator />
      <dc:date>2014-09-19T11:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Variable as expression in script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647688#M237171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;he creation of this variable &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;LET vCycleString = 'IF vYM &amp;gt;= vYearMonth_Beg_ and vYM &amp;lt;= vYearMonth_End_ then'; will not work, because you was writen as text with the " ' " you defined as a text.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to use the IF , and THEN statement, you dont have to create as a string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i dont understand what do you want to create in the variable vCycleString, what you expect would be the result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because the wright way is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vYM &amp;gt;= vYearMonth_Beg_ and vYM &amp;lt;= vYearMonth_End) then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but not assing this result in a variable, because this will not work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pherphas change the order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;if(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;vYM &amp;gt;= vYearMonth_Beg_ and vYM &amp;lt;= vYearMonth_End) then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let createvariable1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let createvariable2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end if;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this help;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 13:38:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647688#M237171</guid>
      <dc:creator>fkeuroglian</dc:creator>
      <dc:date>2014-09-19T13:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Variable as expression in script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647689#M237172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Erica ))) Thnx a lot )))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2014 06:45:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647689#M237172</guid>
      <dc:creator>lylererger</dc:creator>
      <dc:date>2014-09-22T06:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Variable as expression in script</title>
      <link>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647690#M237173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No worries &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, 23 Sep 2014 11:51:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variable-as-expression-in-script/m-p/647690#M237173</guid>
      <dc:creator />
      <dc:date>2014-09-23T11:51:02Z</dc:date>
    </item>
  </channel>
</rss>

