<?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 How do I set the value of a variable based on the value of another variable in an IF THEN statement? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641731#M235090</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying to do a simple series of set variable statements based on the value of another variable, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF $(vCurrentYear) = "2013-14" THEN&lt;/P&gt;&lt;P&gt; SET vPrevYear = "2012-13";&lt;/P&gt;&lt;P&gt;IF $(vCurrentYear) = "2014-15" THEN&lt;/P&gt;&lt;P&gt; SET vPrevYear = "2013-14";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But these cause the script to load nothing at all, and an hour of Googling hasn't gotten me anywhere. This seems like it should be a very simple thing. Is there a better way to do this? Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2014 22:55:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-05T22:55:34Z</dc:date>
    <item>
      <title>How do I set the value of a variable based on the value of another variable in an IF THEN statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641731#M235090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was trying to do a simple series of set variable statements based on the value of another variable, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF $(vCurrentYear) = "2013-14" THEN&lt;/P&gt;&lt;P&gt; SET vPrevYear = "2012-13";&lt;/P&gt;&lt;P&gt;IF $(vCurrentYear) = "2014-15" THEN&lt;/P&gt;&lt;P&gt; SET vPrevYear = "2013-14";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But these cause the script to load nothing at all, and an hour of Googling hasn't gotten me anywhere. This seems like it should be a very simple thing. Is there a better way to do this? Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2014 22:55:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641731#M235090</guid>
      <dc:creator />
      <dc:date>2014-06-05T22:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the value of a variable based on the value of another variable in an IF THEN statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641732#M235091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;make it&lt;/P&gt;&lt;P&gt;if&amp;nbsp; '$(vCurrentYear)'='2013-14' then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if '$(vCurrentYear)'='2014-15'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your variable stores a string so the Dollar sign expansion needs to be enclosed within single quotes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 00:31:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641732#M235091</guid>
      <dc:creator />
      <dc:date>2014-06-06T00:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the value of a variable based on the value of another variable in an IF THEN statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641733#M235092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shawn,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET vCurrentYear = '2013-14';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF vCurrentYear = '2013-14' THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET vPrevYear = '2012-13';&lt;/P&gt;&lt;P&gt;ELSEIF vCurrentYear = '2014-15' THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET vPrevYear = '2013-14';&lt;/P&gt;&lt;P&gt;END IF;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 01:51:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641733#M235092</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-06-06T01:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the value of a variable based on the value of another variable in an IF THEN statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641734#M235093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;set vCurrentYear ='2013-14';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF '$(vCurrentYear)' = '2013-14' THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET vPrevYear = '2012-13';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF $(vCurrentYear) = '2014-15' THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; SET vPrevYear = '2013-14';&lt;/P&gt;&lt;P&gt;&amp;nbsp; END if&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 02:24:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641734#M235093</guid>
      <dc:creator>fkeuroglian</dc:creator>
      <dc:date>2014-06-06T02:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set the value of a variable based on the value of another variable in an IF THEN statement?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641735#M235094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked perfectly.&lt;/P&gt;&lt;P&gt;Thanks so much, Jagan!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jun 2014 15:52:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-set-the-value-of-a-variable-based-on-the-value-of/m-p/641735#M235094</guid>
      <dc:creator />
      <dc:date>2014-06-06T15:52:08Z</dc:date>
    </item>
  </channel>
</rss>

