<?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: Leap Year in previous period comparison in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273074#M461026</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But that seems somewhat strange, if you compare 27th, you compare 27 days, but if you select 28th, the comparison is for 29 days. On the other hand, what will happen you have 29th selected and you will compare it with 28th and when 28th selected, it will again compare to 28th?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Feb 2017 14:32:40 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-02-27T14:32:40Z</dc:date>
    <item>
      <title>Set Analysis: Leap Year in previous period comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273071#M461023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam looking for a best practice solution on my problem:&lt;/P&gt;&lt;P&gt;We still have a lot of old Dashboards which still uses IF functions for calculation (dark times before set Analysis) &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; . Ill upgrade them from time to time and replace the old Expression with new ones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So there is a Expression which shows the sales from the&amp;nbsp; Previous Year --&amp;gt; From &lt;SPAN style="font-size: 13.3333px;"&gt;Date&lt;/SPAN&gt; - To Date.&lt;/P&gt;&lt;P&gt;The Dates are stored in Variables which&amp;nbsp; the user can manipulate via Inputbox.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Expression looks like this: &lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt; ( &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 9pt; font-family: 'Courier New';"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;= &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;addMonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;From_Date&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,-12) &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;AND&lt;/SPAN&gt; &lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;lt;=&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9.0pt; font-family: 'Courier New';"&gt;To_Date&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;))= &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;num&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;MonthEnd&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;To_Date&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;))), &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;Monthend&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;addMonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;To_Date&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,-12)), &lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;addMonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;(&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;To_Date&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;,-12)),(&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Sales&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)))&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;At First i thought i can replace them with using :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;={&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;"&amp;gt;=$(=addMonths(&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;From_Date&lt;/EM&gt;&lt;/STRONG&gt;,-12))&amp;lt;=$(=addMonths(&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;To_Date&lt;/EM&gt;&lt;/STRONG&gt;,-12))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;} &amp;gt;} &lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;Sales&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;But i forgot about the leap Year. So if you compare the date 01.02.2017 to&amp;nbsp; 28.02.2017 with the Previous Year. it should compare it with the end date of 29.02.2016 since its the last day in Februar 2016.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;What would be a good &lt;/SPAN&gt;solution in Set Analysis&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;greetz Lukas&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 14:06:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273071#M461023</guid>
      <dc:creator>luke1986</dc:creator>
      <dc:date>2017-02-27T14:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Leap Year in previous period comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273072#M461024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=sum({$&amp;lt;Date={"&amp;gt;=$(=addMonths(From_Date,-12))&amp;lt;=$(=&lt;SPAN style="color: #ff0000;"&gt;MonthEnd&lt;/SPAN&gt;(To_Date,-12))"} &amp;gt;} Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, I would also use Date() function to make sure that date format matches&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;=Sum(&lt;/STRONG&gt;&lt;STRONG&gt;{$&amp;lt;Date={"&amp;gt;=$(=&lt;SPAN style="color: #ff0000;"&gt;Date(&lt;/SPAN&gt;MonthStart(From_Date, -12)&lt;SPAN style="color: #ff0000;"&gt;, 'DD.MM.YYYY')&lt;/SPAN&gt;)&amp;lt;=$(=&lt;STRONG style="color: #ff0000; font-size: 13.3333px;"&gt;Date(&lt;/STRONG&gt;MonthEnd(To_Date,-12)&lt;STRONG style="color: #ff0000; font-size: 13.3333px;"&gt;, 'DD.MM.YYYY')&lt;/STRONG&gt;)"} &amp;gt;} Sales)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 14:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273072#M461024</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-27T14:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Leap Year in previous period comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273073#M461025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well that locks the end Date to End of Month, but it should still be &lt;SPAN lang="en"&gt;editable. So for example if you select the 27.02.2017 it should output the 27.02.2016 in set analysis. Only if you Select the last in Month, it should look up the last day in Previous Year.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="en"&gt;Greetz Lukas&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 14:22:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273073#M461025</guid>
      <dc:creator>luke1986</dc:creator>
      <dc:date>2017-02-27T14:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Leap Year in previous period comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273074#M461026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But that seems somewhat strange, if you compare 27th, you compare 27 days, but if you select 28th, the comparison is for 29 days. On the other hand, what will happen you have 29th selected and you will compare it with 28th and when 28th selected, it will again compare to 28th?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 14:32:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273074#M461026</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-27T14:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis: Leap Year in previous period comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273075#M461027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with you, its some kind of strange point of view. You will never be able to look back exactly 28 days in this scenario. But its what the customer always had, i thought if there is an easy solution ill just use it. Maybe ill just talk to them and try to change their minds, since it doesnt make any sense to me neither.&amp;nbsp; Thanks anyway!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Feb 2017 14:48:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Leap-Year-in-previous-period-comparison/m-p/1273075#M461027</guid>
      <dc:creator>luke1986</dc:creator>
      <dc:date>2017-02-27T14:48:28Z</dc:date>
    </item>
  </channel>
</rss>

