<?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 Syntax Help on setting variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237950#M88934</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Script IF statements work differently than expression IF statments. Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vLastWeekLastYr = 52;&lt;/P&gt;&lt;P&gt;LET vCurrentWeekThisYr = 53;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF $(vCurrentWeekThisYr) &amp;gt; $(vLastWeekLastYr) THEN&lt;/P&gt;&lt;P&gt;LET vCurrentWeek = $(vLastWeekLastYr);&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;LET vCurrentWeek = $(vCurrentWeekThisYr);&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Feb 2010 20:43:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-02-12T20:43:35Z</dc:date>
    <item>
      <title>Syntax Help on setting variables</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237949#M88933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can someone help me with syntax. There's something wrong here, but I don't know what it is:&lt;/P&gt;&lt;P&gt;LET vLastWeekLastYr = 52;&lt;BR /&gt;LET vCurrentWeekThisYr = 53;&lt;BR /&gt;&lt;BR /&gt;If(&lt;BR /&gt; $(vCurrentWeekThisYr) &amp;gt; $(vLastWeekLastYr),&lt;BR /&gt; LET vCurrentWeek = $(vLastWeekLastYr),&lt;BR /&gt; LET vCurrentWeek = $(vCurrentWeekThisYr)&lt;BR /&gt;);&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2010 20:23:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237949#M88933</guid>
      <dc:creator />
      <dc:date>2010-02-12T20:23:48Z</dc:date>
    </item>
    <item>
      <title>Syntax Help on setting variables</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237950#M88934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Script IF statements work differently than expression IF statments. Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vLastWeekLastYr = 52;&lt;/P&gt;&lt;P&gt;LET vCurrentWeekThisYr = 53;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF $(vCurrentWeekThisYr) &amp;gt; $(vLastWeekLastYr) THEN&lt;/P&gt;&lt;P&gt;LET vCurrentWeek = $(vLastWeekLastYr);&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;LET vCurrentWeek = $(vCurrentWeekThisYr);&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2010 20:43:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237950#M88934</guid>
      <dc:creator />
      <dc:date>2010-02-12T20:43:35Z</dc:date>
    </item>
    <item>
      <title>Syntax Help on setting variables</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237951#M88935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works too:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vLastWeekLastYr = 52;&lt;/P&gt;&lt;P&gt;LET vCurrentWeekThisYr = 53;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCurrentWeek = If(vCurrentWeekThisYr &amp;gt; vLastWeekLastYr, $(vLastWeekLastYr), $(vCurrentWeekThisYr));&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2010 20:45:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237951#M88935</guid>
      <dc:creator />
      <dc:date>2010-02-12T20:45:28Z</dc:date>
    </item>
    <item>
      <title>Syntax Help on setting variables</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237952#M88936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Aaron! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2010 20:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237952#M88936</guid>
      <dc:creator />
      <dc:date>2010-02-12T20:47:23Z</dc:date>
    </item>
    <item>
      <title>Syntax Help on setting variables</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237953#M88937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;There are two different if-statements.&lt;BR /&gt;One that's used inside a load-statement (and that's the one you are using), and another one that's used as a control statement (this is the one you should be using). The syntax is as follows:&lt;/P&gt;&lt;P&gt;if $(vCurrentWeekThisYr) &amp;gt; $(vLastWeekLastYr) then&lt;BR /&gt; LET vCurrentWeek = $(vLastWeekLastYr)&lt;BR /&gt;else&lt;BR /&gt; LET vCurrentWeek = $(vCurrentWeekThisYr)&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;Look in the QV help for more examples.&lt;/P&gt;&lt;P&gt;/Fredrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Feb 2010 20:48:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-Help-on-setting-variables/m-p/237953#M88937</guid>
      <dc:creator />
      <dc:date>2010-02-12T20:48:59Z</dc:date>
    </item>
  </channel>
</rss>

