<?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: I am having a problem doing a sum for a specific date period in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399709#M148746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're subtracting days, not weeks. Try these:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Date={"&amp;gt;$(=weekend(max(Date)-14))&amp;lt;=$(=weekend(max(Date)-7))"}&amp;gt;} &lt;/P&gt;&lt;P&gt;sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Date={"&amp;gt;$(=weekend(max(Date)-7))&amp;lt;=$(=weekend(max(Date)))"}&amp;gt;} sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It still calculates the end of the week of the max Date. That means the last week could have only sales for one day, since the rest of the week lies beyond max Date. If you want the sales of the last 7 days and the week before that leave out the weekend() functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Dec 2012 13:40:18 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2012-12-03T13:40:18Z</dc:date>
    <item>
      <title>I am having a problem doing a sum for a specific date period</title>
      <link>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399708#M148745</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;So here is my issue I need help with. Regardless of the date selected by the user - I want to display last week and the previous week sum totals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a chart object displayed as a straight table. The chart does not have any dimensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To sum last week date range I use the following: sum({$&amp;lt;Date={"&amp;gt;=$(=weekend(max(Date),-1)))&amp;lt;=$(=weekend((max(Date))))"}&amp;gt;} sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To sum the previous week I am using: sum({$&amp;lt;Date={"&amp;gt;=$(=weekstart(max(Date),-2))&amp;lt;=$(=weekend(max(Date),-1))"}&amp;gt;} sales).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not only are these displaying incorrect data - they are displaying the same data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Izzy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 13:16:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399708#M148745</guid>
      <dc:creator />
      <dc:date>2012-12-03T13:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: I am having a problem doing a sum for a specific date period</title>
      <link>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399709#M148746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're subtracting days, not weeks. Try these:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Date={"&amp;gt;$(=weekend(max(Date)-14))&amp;lt;=$(=weekend(max(Date)-7))"}&amp;gt;} &lt;/P&gt;&lt;P&gt;sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Date={"&amp;gt;$(=weekend(max(Date)-7))&amp;lt;=$(=weekend(max(Date)))"}&amp;gt;} sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It still calculates the end of the week of the max Date. That means the last week could have only sales for one day, since the rest of the week lies beyond max Date. If you want the sales of the last 7 days and the week before that leave out the weekend() functions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 13:40:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399709#M148746</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-03T13:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: I am having a problem doing a sum for a specific date period</title>
      <link>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399710#M148747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. But I am still getting the same incorrect answer - and both values are the same (meaning the -14 and -7 don't effect anything).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 13:54:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399710#M148747</guid>
      <dc:creator />
      <dc:date>2012-12-03T13:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: I am having a problem doing a sum for a specific date period</title>
      <link>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399711#M148748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps your Date isn't a date. The calculations don't work on strings. The expressions work fine here. See attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 15:09:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399711#M148748</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2012-12-03T15:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: I am having a problem doing a sum for a specific date period</title>
      <link>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399712#M148749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your answer seems right - but it is still not working for me. I am pretty sure my date field is a date field - how can I be sure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I went back and looked at my formula again. I had written "Date" instead of "date" - how annoying.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 15:39:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/I-am-having-a-problem-doing-a-sum-for-a-specific-date-period/m-p/399712#M148749</guid>
      <dc:creator />
      <dc:date>2012-12-03T15:39:39Z</dc:date>
    </item>
  </channel>
</rss>

