<?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: why let and why set in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415700#M811895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use set when you want to store a complex expression as-is in a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a common best practice in QlikView Development to NOT duplicate identical complex expressions in different places, but to store the expression in a variable and use that variable in different places. Why? Because in the first situation (duplication) when your expression needs to be adjusted, you run the risk of forgetting to change somle instances. While in the second situation, changing the variable assignment will change ALL occurrences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, to store an expression unchanged in a variable, you can use SET to avoid immediate evaluation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the righthandside of both LET and SET will be submitted to $-sign substitution, even if SET in theory shouldn't do anything with the string after the equal sign. That's because $-sign substitution is performed before the statement is parsed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Oct 2017 07:57:41 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2017-10-09T07:57:41Z</dc:date>
    <item>
      <title>why let and why set</title>
      <link>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415695#M811890</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 know set will store the value and let will elevate the value, now i want to know why let and why set please share me the example.&lt;/P&gt;&lt;P&gt;i am aware of below example&lt;/P&gt;&lt;P&gt;set x=2+3 out put as 2+3 and i use $ then it will get 5&lt;/P&gt;&lt;P&gt;let&amp;nbsp; x=2+3 out put as 5&lt;/P&gt;&lt;P&gt;my question is where to keep left and where to keep set in real time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415695#M811890</guid>
      <dc:creator>vinod22kv</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: why let and why set</title>
      <link>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415696#M811891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please check this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/47712"&gt;let and set difference&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 07:06:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415696#M811891</guid>
      <dc:creator>prma7799</dc:creator>
      <dc:date>2017-10-09T07:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: why let and why set</title>
      <link>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415697#M811892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Set values are string and in Let value get evaluated in set variable you can use this string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See ex:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vTableName = 'Table1';&lt;/P&gt;&lt;P&gt;LET vToday = Today();&lt;/P&gt;&lt;P&gt;$(vTableName):&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;ddd&lt;/P&gt;&lt;P&gt;aa&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 07:11:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415697#M811892</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2017-10-09T07:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: why let and why set</title>
      <link>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415698#M811893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is one example of usage differences of them: &lt;A href="https://community.qlik.com/thread/16554"&gt;Problem with date and/or variable and/or WHERE condition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 07:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415698#M811893</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2017-10-09T07:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: why let and why set</title>
      <link>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415699#M811894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H1&gt;&lt;A name="kanchor785"&gt;&lt;/A&gt;Let&lt;/H1&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;let&lt;/SPAN&gt; statement has been created as a complement to the &lt;A class="MCXref_0"&gt;&lt;EM&gt;Set&lt;/EM&gt;&lt;/A&gt; statement, used for defining &lt;A class="MCXref_0"&gt;&lt;EM&gt;Script Variables&lt;/EM&gt;&lt;/A&gt;. The &lt;SPAN class="Bold"&gt;let&lt;/SPAN&gt; statement, in opposition to the &lt;SPAN class="Bold"&gt;set&lt;/SPAN&gt; statement, evaluates the expression on the right side of the '=' before it is assigned to the variable. &lt;/P&gt;&lt;P&gt;The word &lt;SPAN class="Bold"&gt;let&lt;/SPAN&gt; may be omitted, but the statement then becomes a control statement. Such a statement without the keyword &lt;SPAN class="Bold"&gt;let&lt;/SPAN&gt; must be contained within a single script row and may be terminated either with a semicolon or end-of-line. &lt;/P&gt;&lt;P&gt;The syntax is:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;let &lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;variablename&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;=&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;expression&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;Note that the word &lt;SPAN class="Bold"&gt;let&lt;/SPAN&gt; may be omitted. &lt;/P&gt;&lt;P class="Code"&gt;Set x=3+4;&lt;/P&gt;&lt;P class="Code"&gt;Let y=3+4;&lt;/P&gt;&lt;P class="Code"&gt;z=$(y)+1;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;$(x)&lt;/SPAN&gt; will be evaluated as '&lt;SPAN class="Italic"&gt;3+4&lt;/SPAN&gt; '&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;$(y)&lt;/SPAN&gt; will be evaluated as '&lt;SPAN class="Italic"&gt;7&lt;/SPAN&gt;'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;$(z)&lt;/SPAN&gt; will be evaluated as '&lt;SPAN class="Italic"&gt;8&lt;/SPAN&gt;'&lt;/P&gt;&lt;P class="example"&gt;Example:&lt;/P&gt;&lt;P class="Code"&gt;Let T=now( );&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;$(T)&lt;/SPAN&gt; will be given the value of the current time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H1&gt;&lt;A name="kanchor1062"&gt;&lt;/A&gt;Set&lt;/H1&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;set&lt;/SPAN&gt; statement is used for defining &lt;A class="MCXref_0"&gt;&lt;EM&gt;Script Variables&lt;/EM&gt;&lt;/A&gt;. These can be used for substituting strings, paths, drives, etc. &lt;/P&gt;&lt;P&gt;The syntax is:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;set&lt;/SPAN&gt; &lt;SPAN class="Italic"&gt;variablename&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;=&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;string&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P class="Code"&gt;Set FileToUse=Data1.csv;&lt;/P&gt;&lt;P class="Code"&gt;Set Constant="My string";&lt;/P&gt;&lt;P class="Code"&gt;Set BudgetYear=1997;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 07:13:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415699#M811894</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2017-10-09T07:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: why let and why set</title>
      <link>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415700#M811895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use set when you want to store a complex expression as-is in a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is a common best practice in QlikView Development to NOT duplicate identical complex expressions in different places, but to store the expression in a variable and use that variable in different places. Why? Because in the first situation (duplication) when your expression needs to be adjusted, you run the risk of forgetting to change somle instances. While in the second situation, changing the variable assignment will change ALL occurrences.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, to store an expression unchanged in a variable, you can use SET to avoid immediate evaluation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the righthandside of both LET and SET will be submitted to $-sign substitution, even if SET in theory shouldn't do anything with the string after the equal sign. That's because $-sign substitution is performed before the statement is parsed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2017 07:57:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/why-let-and-why-set/m-p/1415700#M811895</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-10-09T07:57:41Z</dc:date>
    </item>
  </channel>
</rss>

