<?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: Last 12 Months expression not working in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500479#M103142</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/244105"&gt;@jalanhart&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would just state the obvious: instead of using autocalendar it is much better practice to use actual calendar which build by yourself with all fields created in the model and not derived from the field.&lt;/P&gt;
&lt;P&gt;Once you do that you can ensure that the type of the date field is correct as well as you can introduce to your calendar flags you may require making your set analysis simpler.&lt;/P&gt;
&lt;P&gt;Importantly you will also make your app performing better.&lt;/P&gt;
&lt;P&gt;cheers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2025 00:59:47 GMT</pubDate>
    <dc:creator>Lech_Miszkiewicz</dc:creator>
    <dc:date>2025-01-09T00:59:47Z</dc:date>
    <item>
      <title>Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500302#M103106</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an expression that I've been trying to show the sum of sales over the last 12 months and I can not seem to get the formula to report anything other than $0.&lt;/P&gt;
&lt;P&gt;here is the expression&amp;nbsp;Sum({&amp;lt; [INVOICE_DATE] ={'&amp;gt;=$(=date(MAX(INVOICE_DATE) - 365))&amp;lt;=$(=Max(INVOICE_DATE))'} &amp;gt;}NET_AMOUNT)&lt;/P&gt;
&lt;P&gt;I know it works in the function expression checker at the bottom because it has the dates I want filled in, but the expression does not work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jalanhart_0-1736296381425.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176248i83AE2DC7F606A205/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jalanhart_0-1736296381425.png" alt="jalanhart_0-1736296381425.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 00:33:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500302#M103106</guid>
      <dc:creator>jalanhart</dc:creator>
      <dc:date>2025-01-08T00:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500329#M103112</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/244105"&gt;@jalanhart&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try to use below expression&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;Sum&lt;/SPAN&gt;&lt;SPAN&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;Year&lt;/SPAN&gt;&lt;SPAN&gt;=,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Month&lt;/SPAN&gt;&lt;SPAN&gt;=,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;[Year Month]&lt;/SPAN&gt;&lt;SPAN&gt;={&lt;/SPAN&gt;&lt;SPAN&gt;"&amp;gt;=$(=Date(MonthStart(AddMonths(Min(Date),-11)),'YYYYMM'))&amp;lt;=$(=Date(MonthStart(AddMonths(Max(Date),0)),'YYYYMM'))"&lt;/SPAN&gt;&lt;SPAN&gt;}&amp;gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;sales&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 08:03:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500329#M103112</guid>
      <dc:creator>pallavi_96</dc:creator>
      <dc:date>2025-01-08T08:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500330#M103113</link>
      <description>&lt;P&gt;Ensure INVOICE_DATE is stored as a date. Use Date() to format it explicitly.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2025 08:16:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500330#M103113</guid>
      <dc:creator>BrunPierre</dc:creator>
      <dc:date>2025-01-08T08:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500475#M103141</link>
      <description>&lt;P&gt;thanks! this seems to be working correctly, though I would still like to have it be an actual 365 days but when i tried to replace the first part it didn't work. I also tried to add [date]= after the year month and that did not work either.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 00:27:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500475#M103141</guid>
      <dc:creator>jalanhart</dc:creator>
      <dc:date>2025-01-09T00:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500479#M103142</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/244105"&gt;@jalanhart&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would just state the obvious: instead of using autocalendar it is much better practice to use actual calendar which build by yourself with all fields created in the model and not derived from the field.&lt;/P&gt;
&lt;P&gt;Once you do that you can ensure that the type of the date field is correct as well as you can introduce to your calendar flags you may require making your set analysis simpler.&lt;/P&gt;
&lt;P&gt;Importantly you will also make your app performing better.&lt;/P&gt;
&lt;P&gt;cheers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 00:59:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500479#M103142</guid>
      <dc:creator>Lech_Miszkiewicz</dc:creator>
      <dc:date>2025-01-09T00:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500481#M103143</link>
      <description>&lt;P&gt;Thanks for the advice! it's something I will implement eventually I'm sure but personally I really like the auto calendar . . . especially in charts where time is my independent variable.&lt;/P&gt;
&lt;P&gt;but i also know that making flags and such are easier if I do them myself&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 01:02:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500481#M103143</guid>
      <dc:creator>jalanhart</dc:creator>
      <dc:date>2025-01-09T01:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500492#M103145</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/244105"&gt;@jalanhart&lt;/a&gt;&amp;nbsp;Use below expression&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sum({&amp;lt; [INVOICE_DATE] ={"&amp;gt;=$(=date(MAX(INVOICE_DATE) - 365))&amp;lt;=$(=Max(INVOICE_DATE))"} &amp;gt;}NET_AMOUNT)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 04:29:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500492#M103145</guid>
      <dc:creator>Bhushan_Mahajan</dc:creator>
      <dc:date>2025-01-09T04:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500602#M103168</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/244105"&gt;@jalanhart&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I think the main issue with your original expression was the use of quotes. I suggest you wrap ' ' around the data strings, and " "&amp;nbsp; around the whole value that is to be evaluated as below.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sum({&amp;lt; [INVOICE_DATE] ={&lt;STRONG&gt;"&lt;/STRONG&gt;&amp;gt;=&lt;STRONG&gt;'&lt;/STRONG&gt;$(=date(MAX(INVOICE_DATE) - 365))&lt;STRONG&gt;'&lt;/STRONG&gt;&amp;lt;='$(=Max(INVOICE_DATE))&lt;STRONG&gt;'"&lt;/STRONG&gt;} &amp;gt;}NET_AMOUNT)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 12:30:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500602#M103168</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2025-01-09T12:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Last 12 Months expression not working</title>
      <link>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500617#M103172</link>
      <description>&lt;P&gt;the correct is with double quotes and addmonths function:&amp;nbsp;Sum({&amp;lt; DATE ={"&amp;gt;=$(=date(AddMonths(MAX(DATE),-12)))&amp;lt;=$(=Max(DATA))"} &amp;gt;} NET_AMOUNT)&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 13:20:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Last-12-Months-expression-not-working/m-p/2500617#M103172</guid>
      <dc:creator>eddyvargas</dc:creator>
      <dc:date>2025-01-09T13:20:35Z</dc:date>
    </item>
  </channel>
</rss>

