<?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 compare with same period last year in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587357#M738746</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;you need to make sure&amp;nbsp;&lt;/P&gt;&lt;P&gt;that the function inside the set analysis returns the date in the same format as your date field&amp;nbsp;&lt;/P&gt;&lt;P&gt;so try adding date around your function and format it&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 01 Jun 2019 18:07:40 GMT</pubDate>
    <dc:creator>lironbaram</dc:creator>
    <dc:date>2019-06-01T18:07:40Z</dc:date>
    <item>
      <title>Set analysis compare with same period last year</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587353#M738745</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;Hi,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;I want to sum last years sales for the same period as &amp;nbsp;selected for this year&amp;nbsp; and have the following expression:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;=&lt;FONT color="#0000ff"&gt;sum&lt;/FONT&gt;({&amp;lt;&lt;FONT color="#800000"&gt;Datefield&lt;/FONT&gt;= {&lt;FONT color="#800000"&gt;"&amp;gt;=$(=Addmonths(min(Datefield)),-12)&amp;lt;=$(=Addmonths(max(Datefield)),-12)"&lt;/FONT&gt;}&amp;gt; } &lt;FONT color="#800000"&gt;Sales&lt;/FONT&gt;) &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;For example, if selected dates are 20190101, 20190201 and 20190301&amp;nbsp;I want to sum sales between 20180101 and 20180301.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;Date field format is 'YYYYYMMDD' and I have one date per month to select&amp;nbsp;from:&amp;nbsp; 20190101, 20190201 and so on.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;I can't figure out why the expression is not working, and would be very thankful for any help.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="4"&gt;Kind regards, Hilde&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587353#M738745</guid>
      <dc:creator>Hilde</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis compare with same period last year</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587357#M738746</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;you need to make sure&amp;nbsp;&lt;/P&gt;&lt;P&gt;that the function inside the set analysis returns the date in the same format as your date field&amp;nbsp;&lt;/P&gt;&lt;P&gt;so try adding date around your function and format it&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Jun 2019 18:07:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587357#M738746</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2019-06-01T18:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis compare with same period last year</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587359#M738747</link>
      <description>To get addmonths() to work your Datefield needs to be recognized as a date. If you use =Addmonths(MAX(Datefield),-12)&lt;BR /&gt;as an expression in your application it should return the correct corresponding date.&lt;BR /&gt;&lt;BR /&gt;Are you making selections in other period fields such as Year, month etc.? If so you will need to cancel out their effect like this: =sum({&amp;lt;Year, Month, Datefield= {"&amp;gt;=$(=Addmonths(min(Datefield)),-12)&amp;lt;=$(=Addmonths(max(Datefield)),-12)"}&amp;gt; } Sales)&lt;BR /&gt;</description>
      <pubDate>Sat, 01 Jun 2019 18:31:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587359#M738747</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-06-01T18:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis compare with same period last year</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587360#M738748</link>
      <description>Oh, I noticed that your parenthesis are a bit off in the addmonths() function. See adjusted expression below.&lt;BR /&gt;&lt;BR /&gt;=sum({&amp;lt;Datefield= {"&amp;gt;=$(=Addmonths(min(Datefield),-12))&amp;lt;=$(=Addmonths(max(Datefield),-12))"}&amp;gt; } Sales)</description>
      <pubDate>Sat, 01 Jun 2019 18:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-compare-with-same-period-last-year/m-p/1587360#M738748</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-06-01T18:33:32Z</dc:date>
    </item>
  </channel>
</rss>

