<?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: Calculations with date as variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617180#M1114118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i make it in this way&lt;/P&gt;&lt;P&gt;let vToday = today();&lt;/P&gt;&lt;P&gt;let endDate = date(vToday,'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;is it correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Feb 2014 09:11:09 GMT</pubDate>
    <dc:creator>yura_ratu</dc:creator>
    <dc:date>2014-02-21T09:11:09Z</dc:date>
    <item>
      <title>Calculations with date as variable</title>
      <link>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617178#M1114116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all. &lt;/P&gt;&lt;P&gt;I have a variable endDate which value is the last day of date range. Now I want to calculate revenue on 7th day before endDate. I've tried&lt;/P&gt;&lt;P&gt;sum({&amp;lt;CurrTransDate={"$(=date($(endDate)-7))"}&amp;gt;}USDSpent)&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;but it doesn't work. I suppose it's because of mistakes in expression. What did I do wrong?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 08:53:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617178#M1114116</guid>
      <dc:creator>yura_ratu</dc:creator>
      <dc:date>2014-02-21T08:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculations with date as variable</title>
      <link>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617179#M1114117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;endDate has to have a numberic value for this to work. A lot of date and time functions return a dual value, meaning a numeric value that also has a text representation. But perhaps endDate is a string value only and you need to use the date# function to create a date from a string value first.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 09:05:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617179#M1114117</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-02-21T09:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Calculations with date as variable</title>
      <link>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617180#M1114118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i make it in this way&lt;/P&gt;&lt;P&gt;let vToday = today();&lt;/P&gt;&lt;P&gt;let endDate = date(vToday,'YYYY-MM-DD');&lt;/P&gt;&lt;P&gt;is it correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 09:11:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617180#M1114118</guid>
      <dc:creator>yura_ratu</dc:creator>
      <dc:date>2014-02-21T09:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculations with date as variable</title>
      <link>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617181#M1114119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that's correct. But what is the default date format? Do you have a line SET DateFormat=.... in your script? What's is the format specified there? Is it the same as the format of the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;CurrTransDate&lt;/SPAN&gt; field? They either have to be the same or you need to specify the correct format in the expression. For example YYYY-MM-DD: &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;sum({&amp;lt;CurrTransDate={"$(=date($(endDate)-7,&lt;EM&gt;&lt;STRONG&gt;'YYYY-MM-DD'&lt;/STRONG&gt;&lt;/EM&gt;))"}&amp;gt;}USDSpent)&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 09:19:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617181#M1114119</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-02-21T09:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Calculations with date as variable</title>
      <link>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617182#M1114120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, formats were different. Thank you! This expression works&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;CurrTransDate={'$(=date(&lt;STRONG&gt;'&lt;/STRONG&gt;$(endDate)&lt;STRONG&gt;'&lt;/STRONG&gt;-7,'YYYY-MM-DD'))'}&amp;gt;}USDSpent) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2014 09:58:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculations-with-date-as-variable/m-p/617182#M1114120</guid>
      <dc:creator>yura_ratu</dc:creator>
      <dc:date>2014-02-21T09:58:25Z</dc:date>
    </item>
  </channel>
</rss>

