<?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: What is difference when we add the variable in script and variable overview in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866190#M303015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maxim is right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$-sign substitution works &lt;EM&gt;everywhere&lt;/EM&gt;, even in the right-hand part of a SET statement. What happens in your SET statement is that both &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;$(=Date(Max(Date),'DD/MM/YYYY'))&lt;/SPAN&gt; and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;$(=Date(Max(Date)-7,'DD/MM/YYYY'))&lt;/SPAN&gt; are immediately evaluated in your script and replaced by the outcome of the expressions &lt;EM&gt;even before the SET statement is executed&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this is the only way you can calculate values in the right-hand part of a SET statement, which is otherwise defined as different from a LET statement because of not executing the right-hand part at all... This is a nice exam/interview question &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;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jul 2015 07:00:42 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-07-14T07:00:42Z</dc:date>
    <item>
      <title>What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866184#M303009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me in understanding the functionality of variable when we declare the in script and in variable overview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ferha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 05:17:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866184#M303009</guid>
      <dc:creator>ferha_jafri</dc:creator>
      <dc:date>2015-07-14T05:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866185#M303010</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;Script:&lt;/P&gt;&lt;P&gt;Generally, we used to store the QVD path or file path in variable in script level.&lt;/P&gt;&lt;P&gt;We can also used to store the maximum or minimum date in order to generate the master calendar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMaxDate = Peek('MaxDate',0,'DateTemp');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We can able to remove the script variable like&lt;/P&gt;&lt;P&gt;Let vMaxDate = ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UI:&lt;/P&gt;&lt;P&gt;We can used to store any color, expression, Currency conversation.&lt;/P&gt;&lt;P&gt;And also, we can use in "InputBox" or any condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps to understand.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 05:27:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866185#M303010</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2015-07-14T05:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866186#M303011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ferha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Very Simple, When we write variable in script level we can edit and when we go for variable overview we can't edit which is our updated requirement on variable like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variable Name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ramya.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 05:30:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866186#M303011</guid>
      <dc:creator />
      <dc:date>2015-07-14T05:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866187#M303012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the variable is defined only in the variable overview, and you need to recover the qvw by using a no-data load, or by restoring it from version control, then you will lose the value/definition of the variable as the variable contents are considered to be data. Therefore I always define important variables in script - this includes expression variables and state variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a variable is only required for the script, and never in the front end, then if it is &lt;EM&gt;first&lt;/EM&gt; defined in the script and set to null before the end of the script, it will not appear in the variable overview when the script completes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 05:34:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866187#M303012</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-07-14T05:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866188#M303013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My issue is when I am declaring a variable as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET Var1=Sum({&amp;lt;Date={"&amp;gt;$(=Date(Max(Date)-7,'DD/MM/YYYY'))&amp;lt;=$(=Date(Max(Date),'DD/MM/YYYY'))"},Week=p(Week)&amp;gt;}Data) in script then dates are not filtering in the range this expression in the script is taking all the dates ,althogh when I am declaring this variable in variable overview it is giving the correct date range ,why this is happening????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 06:44:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866188#M303013</guid>
      <dc:creator>ferha_jafri</dc:creator>
      <dc:date>2015-07-14T06:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866189#M303014</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;Here you need to replace $ with some other sign, say @.&lt;/P&gt;&lt;P&gt;After in your expressions you should you $-sign expansion, like =$(ReplaceSring(Var1,'@','$')). Not sure whether the syntax is correct, but in general this is what can help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Maxim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 06:51:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866189#M303014</guid>
      <dc:creator>maksim_senin</dc:creator>
      <dc:date>2015-07-14T06:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866190#M303015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maxim is right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$-sign substitution works &lt;EM&gt;everywhere&lt;/EM&gt;, even in the right-hand part of a SET statement. What happens in your SET statement is that both &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;$(=Date(Max(Date),'DD/MM/YYYY'))&lt;/SPAN&gt; and &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;$(=Date(Max(Date)-7,'DD/MM/YYYY'))&lt;/SPAN&gt; are immediately evaluated in your script and replaced by the outcome of the expressions &lt;EM&gt;even before the SET statement is executed&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this is the only way you can calculate values in the right-hand part of a SET statement, which is otherwise defined as different from a LET statement because of not executing the right-hand part at all... This is a nice exam/interview question &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;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 07:00:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866190#M303015</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-07-14T07:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866191#M303016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need what is called 'delayed expansion' as you only want the $() expansion taking place when the variable is used later in the front end. Although Set= does not evaluate the expression, the $() expansion occurs before the Set operation. To delay the expansion, you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET Var1='Sum({&amp;lt;Date={"&amp;gt;$' &amp;amp; '(=Date(Max(Date)-7, DD/MM/YYYY'))&amp;lt;=$' &amp;amp; '(=Date(Max(Date), DD/MM/YYYY'))"}, Week=p(Week)&amp;gt;} Data)';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: corrected as Peter pointed out, as well as correcting for Notepad++ mangling the single quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let Var1='Sum({&amp;lt;Date={"&amp;gt;$' &amp;amp; '(=Date(Max(Date)-7, ''DD/MM/YYYY''))&amp;lt;=$' &amp;amp; '(=Date(Max(Date), ''DD/MM/YYYY''))"}, Week=p(Week)&amp;gt;} Data)';&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 07:07:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866191#M303016</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-07-14T07:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866192#M303017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think Jonathan means:&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;&lt;STRONG style=": ; font-size: 10pt; font-family: 'courier new', courier;"&gt;LET&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt; Var1='Sum({&amp;lt;Date={"&amp;gt;$' &amp;amp; '(=Date(Max(Date)-7, DD/MM/YYYY'))&amp;lt;=$' &amp;amp; '(=Date(Max(Date), DD/MM/YYYY'))"}, Week=p(Week)&amp;gt;} Data)';&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 07:17:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866192#M303017</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-07-14T07:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866193#M303018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LET is not working it is giving an error message..and SET is giving null values when I writing $(Var1) in pivot table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 07:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866193#M303018</guid>
      <dc:creator>ferha_jafri</dc:creator>
      <dc:date>2015-07-14T07:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866194#M303019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is giving null for the variable but expression is fine and giving values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 07:54:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866194#M303019</guid>
      <dc:creator>ferha_jafri</dc:creator>
      <dc:date>2015-07-14T07:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866195#M303020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The LET statement has missing quotes (I just copied Jonathan's example) and can be easily fixed. How about this one (corrected for using &lt;SPAN style="font-family: 'courier new', courier;"&gt;$(Var1)&lt;/SPAN&gt;, &lt;EM&gt;not&lt;/EM&gt; &lt;SPAN style="font-family: 'courier new', courier;"&gt;=$(Var1)&lt;/SPAN&gt; in your pivot table expression)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #3d3d3d;"&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #3d3d3d;"&gt; Var1='&lt;STRONG&gt;=&lt;/STRONG&gt;Sum({&amp;lt;Date={"&amp;gt;$' &amp;amp; '(=Date(Max(Date)-7, &lt;STRONG&gt;''&lt;/STRONG&gt;DD/MM/YYYY&lt;STRONG&gt;''&lt;/STRONG&gt;))&amp;lt;=$' &amp;amp; '(=Date(Max(Date), &lt;STRONG&gt;''&lt;/STRONG&gt;DD/MM/YYYY&lt;STRONG&gt;''&lt;/STRONG&gt;))"}, Week=p(Week)&amp;gt;} Data)';&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2015 09:09:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866195#M303020</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-07-14T09:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: What is difference when we add the variable in script and variable overview</title>
      <link>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866196#M303021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Jonathan and Peter for your help it worked now but I want to know one more thing that if we provide the number format of 2 decimal places as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333320617676px; font-family: inherit;"&gt;LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier; color: #3d3d3d;"&gt; Var1='&lt;STRONG style="font-style: inherit; font-size: 13.3333320617676px; font-family: inherit;"&gt;=Num(&lt;/STRONG&gt;Sum({&amp;lt;Date={"&amp;gt;$' &amp;amp; '(=Date(Max(Date)-7,&lt;STRONG style="font-style: inherit; font-size: 13.3333320617676px; font-family: inherit;"&gt;''&lt;/STRONG&gt;DD/MM/YYYY&lt;STRONG style="font-style: inherit; font-size: 13.3333320617676px; font-family: inherit;"&gt;''&lt;/STRONG&gt;))&amp;lt;=$' &amp;amp; '(=Date(Max(Date), &lt;STRONG style="font-style: inherit; font-size: 13.3333320617676px; font-family: inherit;"&gt;''&lt;/STRONG&gt;DD/MM/YYYY&lt;STRONG style="font-style: inherit; font-size: 13.3333320617676px; font-family: inherit;"&gt;''&lt;/STRONG&gt;))"}, Week=p(Week)&amp;gt;} Data),'#,##0.00''; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it is not converting to 2 decimal places.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 04:36:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/What-is-difference-when-we-add-the-variable-in-script-and/m-p/866196#M303021</guid>
      <dc:creator>ferha_jafri</dc:creator>
      <dc:date>2015-07-15T04:36:52Z</dc:date>
    </item>
  </channel>
</rss>

