<?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: Sum for DateRange in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873752#M72077</link>
    <description>&lt;P&gt;Thank you so much, this was my mistake!&lt;/P&gt;</description>
    <pubDate>Tue, 21 Dec 2021 11:12:37 GMT</pubDate>
    <dc:creator>Luca1</dc:creator>
    <dc:date>2021-12-21T11:12:37Z</dc:date>
    <item>
      <title>Sum for DateRange</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873559#M72057</link>
      <description>&lt;P&gt;I want to sum up all Sales that are further in the past than 365 days. However, my current code returns 0. I suspect that there are some formatting issues with the max() function and the YearMonth format, but I'm not sure about that. Thank you for your help!&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;=sum(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;[OrderDate.autoCalendar.YearMonth]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = {'&amp;lt; max([OrderDate.autoCalendar.YearMonth]) - 365'}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;BR /&gt;Sales&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:23:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873559#M72057</guid>
      <dc:creator>Luca1</dc:creator>
      <dc:date>2024-11-15T23:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for DateRange</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873560#M72058</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Try this may be, assuming YearMonth is of type date.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=sum(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;[OrderDate.autoCalendar.YearMonth]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = {&amp;lt;$(=max([OrderDate.autoCalendar.YearMonth]) - 365)}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sales&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 00:44:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873560#M72058</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2021-12-21T00:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for DateRange</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873562#M72059</link>
      <description>&lt;P&gt;Hey, unfortunately this didn't help - I'm still getting 0 as a result even though that shouldn't be the case. But I appreciate your support!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 00:56:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873562#M72059</guid>
      <dc:creator>Luca1</dc:creator>
      <dc:date>2021-12-21T00:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for DateRange</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873564#M72060</link>
      <description>&lt;P&gt;Can you see at the bottom of the expression editor, normally I correct my formatting by looking at what I see over there...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Digvijay_Singh_0-1640048613874.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/68979iC3579F7AE3F3DA66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Digvijay_Singh_0-1640048613874.png" alt="Digvijay_Singh_0-1640048613874.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 01:03:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873564#M72060</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2021-12-21T01:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for DateRange</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873590#M72061</link>
      <description>&lt;P&gt;Could it be that you are making selections that are in conflict with your set expression?&lt;/P&gt;
&lt;P&gt;What happens if you only make selections in the [OrderDate.autoCalendar.YearMonth] field?&lt;/P&gt;
&lt;P&gt;You could also try to put double quotes around your modifier like I've done in my expression below.&lt;/P&gt;
&lt;P&gt;=sum({&amp;lt; [OrderDate.autoCalendar.YearMonth] =&amp;nbsp; {"&amp;lt; $(=addyears(max([OrderDate.autoCalendar.YearMonth]),-1))"}&amp;gt;}Sales)&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 05:04:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873590#M72061</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-12-21T05:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for DateRange</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873657#M72066</link>
      <description>&lt;P&gt;Your suggestion doesn't work neither. Let me maybe elaborate on stuff that I've tried and behavior that I could observe:&lt;BR /&gt;1. If I use&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;=sum({&amp;lt;[OrderDate.autoCalendar.Year]={"2017"}&amp;gt;} Sales)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;the output will be reasonable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. If try to achieve the same using&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;sum({&amp;lt;[OrderDate.autoCalendar.Year]={"=max(OrderDate.autoCalendar.Year)"}&amp;gt;)&lt;/LI-CODE&gt;
&lt;P&gt;the output is 0.&lt;BR /&gt;&lt;BR /&gt;3. However, if I put&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;=max([OrderDate.autoCalendar.Year])&lt;/LI-CODE&gt;
&lt;P&gt;to a separate KPI cell, the output is 2017 (as expected).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, I think that you are right about that the set expression causes the error. I just don't understand what I do wrong.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 08:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873657#M72066</guid>
      <dc:creator>Luca1</dc:creator>
      <dc:date>2021-12-21T08:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for DateRange</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873745#M72076</link>
      <description>&lt;LI-CODE lang="markup"&gt;sum({&amp;lt;[OrderDate.autoCalendar.Year]={"=max(OrderDate.autoCalendar.Year)"}&amp;gt;)&lt;/LI-CODE&gt;
&lt;P&gt;You need to dollarexpand your expression in order to get the expression above to to work. Try changing it as I did below.&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;sum({&amp;lt;[OrderDate.autoCalendar.Year]={"$(=max(OrderDate.autoCalendar.Year))"}&amp;gt;)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 21 Dec 2021 11:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873745#M72076</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2021-12-21T11:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sum for DateRange</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873752#M72077</link>
      <description>&lt;P&gt;Thank you so much, this was my mistake!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 11:12:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-for-DateRange/m-p/1873752#M72077</guid>
      <dc:creator>Luca1</dc:creator>
      <dc:date>2021-12-21T11:12:37Z</dc:date>
    </item>
  </channel>
</rss>

