<?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 with AddYears in condition in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666350#M50170</link>
    <description>&lt;P&gt;&lt;SPAN&gt;try this &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$(=Date(AddYears(min([Data]),-1),'YOURFORMAT'))&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jan 2020 15:39:37 GMT</pubDate>
    <dc:creator>dplr-rn</dc:creator>
    <dc:date>2020-01-16T15:39:37Z</dc:date>
    <item>
      <title>Sum with AddYears in condition</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666241#M50161</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I want to sum same period of previous year according to seleccion.&lt;/P&gt;&lt;P&gt;When I put this in expression it works for the seleccion (I know it's not needed, it was addesd just to check code)&lt;/P&gt;&lt;P&gt;sum({&amp;lt; [Data] = {"&amp;gt;=$(=min([Data])) &amp;lt;=$(=max([Data]))"} &amp;gt;} QtdCx)&lt;/P&gt;&lt;P&gt;But when I try the same with AddYears() it returns 0!&lt;/P&gt;&lt;P&gt;sum({&amp;lt; [Data] = {"&amp;gt;=$(=AddYears(min([Data]),-1)) &amp;lt;=$(=AddYears(max([Data]),-1))"} &amp;gt;} QtdCx)&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 13:46:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666241#M50161</guid>
      <dc:creator>Paulonst</dc:creator>
      <dc:date>2021-04-01T13:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with AddYears in condition</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666268#M50164</link>
      <description>&lt;P&gt;that is odd.&amp;nbsp;&lt;/P&gt;&lt;P&gt;try formatting about the addyears function to your date format&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 14:26:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666268#M50164</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2020-01-16T14:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with AddYears in condition</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666345#M50169</link>
      <description>&lt;P&gt;On my script this is the date format&lt;BR /&gt;SET DateFormat='DD/MM/YYYY';&lt;/P&gt;&lt;P&gt;Can you please explain better your suggestion?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 15:37:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666345#M50169</guid>
      <dc:creator>Paulonst</dc:creator>
      <dc:date>2020-01-16T15:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with AddYears in condition</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666350#M50170</link>
      <description>&lt;P&gt;&lt;SPAN&gt;try this &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$(=Date(AddYears(min([Data]),-1),'YOURFORMAT'))&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 15:39:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666350#M50170</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2020-01-16T15:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with AddYears in condition</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666361#M50172</link>
      <description>&lt;P&gt;Tried like this and same result: 0!&lt;/P&gt;&lt;P&gt;sum({&amp;lt; [Data] = {"&amp;gt;=$(=Date(AddYears(min([Data]),-1),'DD/MM/YYYY')) &amp;lt;=$(=date(AddYears(max([Data]),-1),'DD/MM/YYYY'))"} &amp;gt;} QtdCx)&lt;/P&gt;&lt;P&gt;To try to help, here's the return of this code:&lt;BR /&gt;min([Data]) : 01/01/2020&lt;BR /&gt;max([Data]):16/01/2020&lt;BR /&gt;AddYears(min([Data]),-1):01/01/2019&lt;BR /&gt;AddYears(max([Data]),-1): 16/01/2019&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 15:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666361#M50172</guid>
      <dc:creator>Paulonst</dc:creator>
      <dc:date>2020-01-16T15:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with AddYears in condition</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666370#M50173</link>
      <description>&lt;P&gt;as i said the original one (without date formatting) looks correct and works for me on my own example.&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you see a preview of the output like below?&lt;/P&gt;&lt;P&gt;gut feeling is its something to do with date format&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.jpg" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/26996i87FEE8FFE6A7DF89/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.jpg" alt="Capture.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 15:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666370#M50173</guid>
      <dc:creator>dplr-rn</dc:creator>
      <dc:date>2020-01-16T15:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with AddYears in condition</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666375#M50174</link>
      <description>&lt;P&gt;I think your expression is fine. Only you need to exclude the other time filters to work it properly&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Year,Month,[Data],&lt;/STRONG&gt;&lt;/FONT&gt; [Data] = {"&amp;gt;=$(=AddYears(min([Data]),-1)) &amp;lt;=$(=AddYears(max([Data]),-1))"} &amp;gt;} QtdCx)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 15:52:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666375#M50174</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-01-16T15:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with AddYears in condition</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666393#M50177</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp; for the solution and&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49412"&gt;@dplr-rn&lt;/a&gt;&amp;nbsp;for the help!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 16:37:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-AddYears-in-condition/m-p/1666393#M50177</guid>
      <dc:creator>Paulonst</dc:creator>
      <dc:date>2020-01-16T16:37:19Z</dc:date>
    </item>
  </channel>
</rss>

