<?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: Working with Variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523242#M1149233</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There can be several things, but the most likely is that your FromDate is a &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;string &lt;/STRONG&gt;&lt;/SPAN&gt;(like '2013-01-01') that gets automatically interpreted when it is the operand in the comparison. But if the operand is '2013-01-01'-7 then you will have a type mismatch in the subtraction that results in the operand being NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using numeric variables, or use an interpretation function in your expression, e.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PeriodDate&amp;gt;=Date#(FromDate)-7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A second, unrelated problem might occur from the fact that PeriodDate is unaggregated. So if you have several possible values, this will be undetermined. Use the following instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(PeriodDate)&amp;gt;=Date#(FromDate)-7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Jun 2013 12:35:10 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2013-06-29T12:35:10Z</dc:date>
    <item>
      <title>Working with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523241#M1149232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QlikCommunity,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this small problem , i've set up 2 variables to present the from and to date selected by a user to determine between which dates he would like to see his sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now , if i want to compare those to let's say 7 days before the given date , what can i do ? i thought it was simple and i used this formula : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(=if(PeriodDate&amp;gt;=FromDate-7 AND PeriodDate &amp;lt;=ToDate-7 , sum(sales))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it did not work . when i remove the "-7" from both ends , it works and shows me ,well, the sales between the period dates , which are btw numbers translated into dates par example : 41445 , etc. . . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why cant QlikView accept substracting 7 from a variable that is determined as, par example, 41446 ?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 11:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523241#M1149232</guid>
      <dc:creator />
      <dc:date>2013-06-29T11:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523242#M1149233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There can be several things, but the most likely is that your FromDate is a &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;string &lt;/STRONG&gt;&lt;/SPAN&gt;(like '2013-01-01') that gets automatically interpreted when it is the operand in the comparison. But if the operand is '2013-01-01'-7 then you will have a type mismatch in the subtraction that results in the operand being NULL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using numeric variables, or use an interpretation function in your expression, e.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PeriodDate&amp;gt;=Date#(FromDate)-7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A second, unrelated problem might occur from the fact that PeriodDate is unaggregated. So if you have several possible values, this will be undetermined. Use the following instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max(PeriodDate)&amp;gt;=Date#(FromDate)-7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 12:35:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523242#M1149233</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2013-06-29T12:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523243#M1149234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;actually Henric , my FromDate and ToDate variables are numbers , as in the user picks them from a calendar and are presented in a number such as 41233 , not 2013-01-01 . i tried the first formula , and it gave me the same outcome as my old one , and the second just gave me an error. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 12:23:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523243#M1149234</guid>
      <dc:creator />
      <dc:date>2013-07-01T12:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523244#M1149235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;Try below process&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;vFmDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue; font-family: 'Courier New';"&gt;peek&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;('ORIGINALDAY',0,'Maxtimes'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;vFromDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue; font-family: 'Courier New';"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue; font-family: 'Courier New';"&gt;MonthStart&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon; font-family: 'Courier New';"&gt;vFmDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;,1),'YYYYMMDD');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;vToDate&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt; = &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue; font-family: 'Courier New';"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: blue; font-family: 'Courier New';"&gt;MonthEnd&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: maroon; font-family: 'Courier New';"&gt;vFmDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;,1),'YYYYMMDD'); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9pt; color: black; font-family: 'Courier New';"&gt;Regards-bika&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 12:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523244#M1149235</guid>
      <dc:creator />
      <dc:date>2013-07-01T12:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523245#M1149236</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;Try the below expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(=if(PeriodDate&amp;gt;=date(date(FromDate)-7) AND PeriodDate &amp;lt;=date(date(ToDate)-7) , sum(sales))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 13:08:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523245#M1149236</guid>
      <dc:creator />
      <dc:date>2013-07-01T13:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Variables</title>
      <link>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523246#M1149237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect , you're a genius .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 13:41:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Working-with-Variables/m-p/523246#M1149237</guid>
      <dc:creator />
      <dc:date>2013-07-01T13:41:29Z</dc:date>
    </item>
  </channel>
</rss>

