<?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: Trouble with variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564789#M210810</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post a sample that demonstrates the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Apr 2014 09:54:48 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2014-04-11T09:54:48Z</dc:date>
    <item>
      <title>Trouble with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564788#M210809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a selection on date like 18/03/2014&lt;/P&gt;&lt;P&gt;THEN max(DateExerNum) = 18/03/2014&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;who can explain why&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;This&lt;/P&gt;&lt;P&gt;SET vPriorMaxDate&amp;nbsp;&amp;nbsp;&amp;nbsp; = "=addmonths(max(DateExerNum), -12)";&lt;/P&gt;&lt;P&gt;returns&amp;nbsp; 31/12/1899&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WRONG VALUE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This&lt;/P&gt;&lt;P&gt;SET vPriorMaxDate&amp;nbsp;&amp;nbsp;&amp;nbsp; = "=(max(DateExerNum)-365)";&lt;/P&gt;&lt;P&gt;returns 18/03/2013&amp;nbsp; RIGHT VALUE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 09:41:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564788#M210809</guid>
      <dc:creator />
      <dc:date>2014-04-11T09:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564789#M210810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post a sample that demonstrates the issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 09:54:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564789#M210810</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-04-11T09:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564790#M210811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I did a little inline load and put your two SET expressions in the load script. Both return the same &lt;EM&gt;correct&lt;/EM&gt; result when used in a text box, for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are you doing to set DateExerNum?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 10:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564790#M210811</guid>
      <dc:creator>ThornOfCrowns</dc:creator>
      <dc:date>2014-04-11T10:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564791#M210812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its evaluating the first expression. But I dont understand the dfference between let and set here..both of them working in a similar way. I have used this exp:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; set &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;v2&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"=addmonths(max(Date),-12)"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;This works fine.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 10:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564791#M210812</guid>
      <dc:creator />
      <dc:date>2014-04-11T10:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564792#M210813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let: Calculates the expression assigned to it and sets the expression result to the variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set: Assigns the value(or expression which is after the equal sign) as it is without compute.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set vVar=2+3; //vVar has the expression 2+3 as value and you have to compute it using $(vVar) which returns 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Let vVar=2+3;//vVar has the computed value 5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It doesn't matter too much with strings, as in this case, as it works either way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 10:05:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564792#M210813</guid>
      <dc:creator>ThornOfCrowns</dc:creator>
      <dc:date>2014-04-11T10:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564793#M210814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The addmonths function will return a date as a dual value, e.g. with a numeric value and as a formatted string. That string is probably not interpreted as a date when you use it later, but instead as 18 divided by 3 divided by 2013. That returns a very small number (close to 0) that when shown as a date returns a date close to the start of the calendar (day zero).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 10:06:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564793#M210814</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-04-11T10:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564794#M210815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes i could check the result hasn't a date format but i can't use date function like&lt;/P&gt;&lt;P&gt;SET vPriorMaxDate&amp;nbsp;&amp;nbsp;&amp;nbsp; = "=date(addmonths(max(DateExerNum), -12))";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which returns the same wrong result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you everybody for your answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 11:19:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564794#M210815</guid>
      <dc:creator />
      <dc:date>2014-04-11T11:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with variables</title>
      <link>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564795#M210816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Gysbert&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you gave me the missign clue&lt;/P&gt;&lt;P&gt;SET vPriorMaxDate&amp;nbsp;&amp;nbsp;&amp;nbsp; = "=num(addmonths(max(Bud.DateExerNum), -12))";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2014 11:39:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Trouble-with-variables/m-p/564795#M210816</guid>
      <dc:creator />
      <dc:date>2014-04-11T11:39:59Z</dc:date>
    </item>
  </channel>
</rss>

