<?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 How compare two quarter in different years? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253986#M581844</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This part of the expression&lt;/P&gt;&lt;P&gt;{&amp;lt;DATE= {"&amp;gt;=$(=quarterstart(min(DATE),-4))&amp;lt;$(=quarterstart(min(DATE),-3))"}, Quarter=, Year=, Month=, Day, WeekDay=, WeekYear= &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is a set expression. If you are not familiar with set analysis, please have a look at the Help - set analysis, and for point in time analysis like that I found this blog quite useful:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://iqlik.wordpress.com/2010/11/27/the-magic-of-set-analysis-point-in-time-reporting/"&gt;http://iqlik.wordpress.com/2010/11/27/the-magic-of-set-analysis-point-in-time-reporting/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What my above set expression basically does is setting a selection only in the context of the aggregation expression (i.e. sum( Value) ). I clear all selections in the calendar fields using just the field name and equal sign, like Quarter= , and for field DATE, I set a new list of values that I determine by use of a search expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&amp;gt;=$(=quarterstart(min(DATE),-4))&amp;lt;$(=quarterstart(min(DATE),-3))"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, the dollar sign expansion (another important piece, please look also for dollar sign expansion into the Help) will be evaluated first:&lt;/P&gt;&lt;P&gt;For example, if you select todays quarter Q1 and year 2012, min(DATE) will be 2012-01-01 or its numerical representation. Quarterstart with second parameter -4 resp. -3 will return the start of quarter 4 quarters back resp. 3 quarters back. So the search looks like this after dollar sign expansion (depending on your date format settings):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&amp;gt;=2011-01-01&amp;lt;2011-04-01"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we look for all DATEs that are larger equal Jan 1st 2011 and smaller than April 1st 2011, which should be ok for this quarter one year back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2012 15:04:03 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-01-05T15:04:03Z</dc:date>
    <item>
      <title>How compare two quarter in different years?</title>
      <link>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253983#M581841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I want to know how to compare two quarter in different years in a Chart. For example If I select Q2 and select year 2010, I want to compared it with the previews year Q2 of 2009, I have try but no luck I will appreciate your &lt;/P&gt;&lt;P&gt;help Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;This is how I read the calendar (Example)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0pt 0pt 0pt 0.5in;"&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;MasterCalendar:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0pt 0pt 0pt 0.5in;"&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;TempDate&lt;/SPAN&gt; &lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;DATE&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0pt 0pt 0pt 0.5in;"&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0pt 0pt 0pt 0.5in;"&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0pt 0pt 0pt 0.5in;"&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Day&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0pt 0pt 0pt 0.5in;"&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Weekday&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WeekDay&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;BR /&gt;'Q' &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;ceil&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;month&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) / 3) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;Quarter&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0pt 0pt 0pt 0.5in;"&gt;&lt;SPAN style="color: black; font-size: 9pt; font-family: 'Courier New';"&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Week&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;)&amp;amp;'-'&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;TempDate&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;WeekYear&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 13:22:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253983#M581841</guid>
      <dc:creator />
      <dc:date>2012-01-05T13:22:07Z</dc:date>
    </item>
    <item>
      <title>How compare two quarter in different years?</title>
      <link>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253984#M581842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For current selection, you do something like &lt;/P&gt;&lt;P&gt;=sum(Value) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then try&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;DATE= {"&amp;gt;=$(=quarterstart(min(DATE),-4))&amp;lt;$(=quarterstart(min(DATE),-3))"}, Quarter=, Year=, Month=, Day, WeekDay=, WeekYear= &amp;gt;} Value)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to retrieve the sum of Values for the same Quarter one year back (complete Quarter, not quarter to date).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 14:06:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253984#M581842</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-05T14:06:12Z</dc:date>
    </item>
    <item>
      <title>How compare two quarter in different years?</title>
      <link>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253985#M581843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help its works &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you can explain the expression I will appreciate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 14:33:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253985#M581843</guid>
      <dc:creator />
      <dc:date>2012-01-05T14:33:30Z</dc:date>
    </item>
    <item>
      <title>How compare two quarter in different years?</title>
      <link>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253986#M581844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This part of the expression&lt;/P&gt;&lt;P&gt;{&amp;lt;DATE= {"&amp;gt;=$(=quarterstart(min(DATE),-4))&amp;lt;$(=quarterstart(min(DATE),-3))"}, Quarter=, Year=, Month=, Day, WeekDay=, WeekYear= &amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is a set expression. If you are not familiar with set analysis, please have a look at the Help - set analysis, and for point in time analysis like that I found this blog quite useful:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://iqlik.wordpress.com/2010/11/27/the-magic-of-set-analysis-point-in-time-reporting/"&gt;http://iqlik.wordpress.com/2010/11/27/the-magic-of-set-analysis-point-in-time-reporting/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What my above set expression basically does is setting a selection only in the context of the aggregation expression (i.e. sum( Value) ). I clear all selections in the calendar fields using just the field name and equal sign, like Quarter= , and for field DATE, I set a new list of values that I determine by use of a search expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&amp;gt;=$(=quarterstart(min(DATE),-4))&amp;lt;$(=quarterstart(min(DATE),-3))"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, the dollar sign expansion (another important piece, please look also for dollar sign expansion into the Help) will be evaluated first:&lt;/P&gt;&lt;P&gt;For example, if you select todays quarter Q1 and year 2012, min(DATE) will be 2012-01-01 or its numerical representation. Quarterstart with second parameter -4 resp. -3 will return the start of quarter 4 quarters back resp. 3 quarters back. So the search looks like this after dollar sign expansion (depending on your date format settings):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"&amp;gt;=2011-01-01&amp;lt;2011-04-01"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we look for all DATEs that are larger equal Jan 1st 2011 and smaller than April 1st 2011, which should be ok for this quarter one year back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 15:04:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253986#M581844</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-01-05T15:04:03Z</dc:date>
    </item>
    <item>
      <title>How compare two quarter in different years?</title>
      <link>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253987#M581845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;Thanks for the explanation .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2012 15:12:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253987#M581845</guid>
      <dc:creator />
      <dc:date>2012-01-05T15:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: How compare two quarter in different years?</title>
      <link>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253988#M581846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am working with qlik sense and I have an issue to compare my actual quarter with the previous quarter.&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/135170_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;for exemple&lt;/P&gt;&lt;P&gt;how can I calculate the difference for each quarter with the previous and if the value is bigger, background color it in red as in the exemple.&lt;/P&gt;&lt;P&gt;In the exemple I used static value to compare like : if(value &amp;lt;20, red()).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for the replays.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2016 13:15:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-compare-two-quarter-in-different-years/m-p/253988#M581846</guid>
      <dc:creator />
      <dc:date>2016-08-22T13:15:06Z</dc:date>
    </item>
  </channel>
</rss>

