<?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: Set Analysis: select single date, but return sum for the entire week in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658276#M49299</link>
    <description>&lt;P&gt;Rwunderlich,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sum({$&amp;lt;DATE_FIELD={"&amp;gt;=$(=WEEKSTART(Min(DATE_FIELD)))&amp;lt;=$(WEEKEND(Max(DATE_FIELD)))"},&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;DATE_FIELD=&lt;/STRONG&gt;&lt;SPAN&gt;&amp;gt;} SALES)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This does work but makes my table display all the weeks contained in the data model,&amp;nbsp; which makes the app really slow.&amp;nbsp; Any way eliminate this behavior? If a user selects a date, the table should display only the week containing that date, with the total SALES value for that week, and not on that date, or all the weeks in the model.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Mon, 16 Dec 2019 23:01:13 GMT</pubDate>
    <dc:creator>jhdalben</dc:creator>
    <dc:date>2019-12-16T23:01:13Z</dc:date>
    <item>
      <title>Set Analysis: select single date, but return sum for the entire week</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658178#M49287</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to write a set analysis expression to display the sum of a field based on the entire week of a selected date. What I have by now is the following:&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;DATE_FIELD={"&amp;gt;=$(=WEEKSTART(Min(DATE_FIELD)))&amp;lt;=$(WEEKEND(Max(DATE_FIELD)))"}&amp;gt;} SALES)&lt;/P&gt;&lt;P&gt;However, when I select a single date, this sum returns the sum only for that date, and not for the entire week. Any ideias on how to implement this?&lt;/P&gt;&lt;P&gt;Also, if a user selects two dates from two distinct weeks, the expression should return the sales of both weeks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your attention.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 20:43:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658178#M49287</guid>
      <dc:creator>jhdalben</dc:creator>
      <dc:date>2021-12-21T20:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: select single date, but return sum for the entire week</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658198#M49290</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Add a modifier to ignore the DATE_FIELD selection:&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;&lt;STRIKE&gt;&lt;FONT face="courier new,courier"&gt;Sum({$&amp;lt;DATE_FIELD={"&amp;gt;=$(=WEEKSTART(Min(DATE_FIELD)))&amp;lt;=$(WEEKEND(Max(DATE_FIELD)))"}, &lt;STRONG&gt;DATE_FIELD=&lt;/STRONG&gt;&amp;gt;} SALES)&lt;/FONT&gt;&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;Alternatively, if you have a Week field in your calendar you can probably simplify to:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Sum({$&amp;lt;Week=P(DATE_FIELD), DATE_FIELD=&amp;gt;} SALES)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;BR /&gt;&lt;A href="http://masterssummit.com" target="_blank" rel="noopener"&gt;http://masterssummit.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://qlikviewcookbook.com" target="_blank" rel="noopener"&gt;http://qlikviewcookbook.com&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://www.easyqlik.com" target="_blank" rel="noopener"&gt;http://www.easyqlik.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 04:49:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658198#M49290</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2019-12-17T04:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: select single date, but return sum for the entire week</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658276#M49299</link>
      <description>&lt;P&gt;Rwunderlich,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sum({$&amp;lt;DATE_FIELD={"&amp;gt;=$(=WEEKSTART(Min(DATE_FIELD)))&amp;lt;=$(WEEKEND(Max(DATE_FIELD)))"},&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;DATE_FIELD=&lt;/STRONG&gt;&lt;SPAN&gt;&amp;gt;} SALES)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This does work but makes my table display all the weeks contained in the data model,&amp;nbsp; which makes the app really slow.&amp;nbsp; Any way eliminate this behavior? If a user selects a date, the table should display only the week containing that date, with the total SALES value for that week, and not on that date, or all the weeks in the model.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 23:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658276#M49299</guid>
      <dc:creator>jhdalben</dc:creator>
      <dc:date>2019-12-16T23:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: select single date, but return sum for the entire week</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658282#M49301</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Actually, Rwunderlich's solution does work, but there was a typo just before WEEKEND, and there was no need for the DATE_FIELD= part&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;Sum({$&amp;lt;DATE_FIELD={"&amp;gt;=$(=WEEKSTART(Min(DATE_FIELD)))&amp;lt;=$(=WEEKEND(Max(DATE_FIELD)))"}} SALES)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;What was happening was that I had two objects do filter dates: DatePicker, which dealt directly with the DATE_FIELD field, and a simple date filter, which had a dimension Date, given by Date(DATE_FIELD, 'DD/MM/YYYY'), and filtering with these two objects had different impacts on my table object. As the expression uses the&amp;nbsp;DATE_FIELD field, only the DatePicker object worked, but the simple filter didn't.&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;Thanks for the help!&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 01:23:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-select-single-date-but-return-sum-for-the-entire/m-p/1658282#M49301</guid>
      <dc:creator>jhdalben</dc:creator>
      <dc:date>2019-12-17T01:23:46Z</dc:date>
    </item>
  </channel>
</rss>

