<?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: Week to week  and quarter to quarter comparison in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551066#M205813</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a master calendar that will generate all the dates. See this discussion: &lt;A href="https://community.qlik.com/thread/66717"&gt;Tutorial - Using Common Date Dimensions and Shared Calendars&lt;/A&gt;. If you use the QVC library to generate the master calendar you automagically some _*Serial fields too. Those are not meant to be used in listboxes, but only in expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try to explain the problem with the Q1, Q2 etc. Suppose you select 2013 and Q1. What's the previous quarter? It's not Q0. That doesn't exist. It's not possible to take a value from the Quarter field and subtract 1 from it to get the previous quarter. With a serial field this is possible. It will have for example values 1 for Q1-2012, 2 for Q2-2012, 3 for Q3-2012, 4 for Q4-2012 and 5 for Q1-2013. Now if you select 2013 in the year field and Q1 in the quarter field you should see only value 5 as possible value in the _QuarterSerial field. Since it's a numeric field you can subtract 1 from it: 5 - 1 = 4. And value 4 represents Q4-2012, which is indeed the previous quarter of Q1-2013.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Jan 2014 18:35:21 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2014-01-03T18:35:21Z</dc:date>
    <item>
      <title>Week to week  and quarter to quarter comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551062#M205809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Folks,&lt;/P&gt;&lt;P&gt;I need some help help in comparing the current week and previous week for the max year and max month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i used this expression for calculating the weeks&lt;/P&gt;&lt;P&gt;'Week-'&amp;amp;(1+CEIL((FLOOR([Accessed Date])-FLOOR(WEEKEND(MONTHSTART([Accessed Date]),0,-1)))/7))&amp;nbsp;&amp;nbsp;&amp;nbsp; AS Week,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so i i get&amp;nbsp; Week-1,week-2,week-3,week-4,week-5..&lt;/P&gt;&lt;P&gt;now i want to write an expression&amp;nbsp; for current week selected and previous week which has to be dyanmic , depending on the week selected&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&amp;nbsp; comparison between&amp;nbsp; quarters&lt;/P&gt;&lt;P&gt;'Q' &amp;amp; CEIL(MONTH([Accessed Date])/3)&amp;nbsp; AS [Quarter],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q2 and Q1 expression depending on the quarter selected... current Quarter and Previous Quarter for the Year selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 16:35:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551062#M205809</guid>
      <dc:creator>shree909</dc:creator>
      <dc:date>2014-01-03T16:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Week to week  and quarter to quarter comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551063#M205810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create numeric serial week and quarter fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;autonumber(weekstart(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Accessed Date]&lt;/SPAN&gt;),'WeekSerial') as _WeekSerial&lt;/P&gt;&lt;P&gt;autonumber(quarterstart(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Accessed Date]&lt;/SPAN&gt;),'QuarterSerial') as _QuarterSerial&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then use these new fields in set analysis expressions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;current week: sum({&amp;lt;_WeekSerial={'$(=max(_WeekSerial))'}&amp;gt;}&lt;/P&gt;&lt;P&gt;previous week: sum({&amp;lt;Year=,Month=, _WeekSerial={'$(=max(_WeekSerial)-1)'}&amp;gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 16:46:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551063#M205810</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-01-03T16:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: Week to week  and quarter to quarter comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551064#M205811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply when i am using the Autonumber for quarter i am getting 6 quarters which are not matching with the Q1,Q2,Q3,Q4 and same thing happens for Week,,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="week.PNG.png" class="jive-image" src="https://community.qlik.com/legacyfs/online/51062_week.PNG.png" style="width: 620px; height: 90px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover i don't have continuous dates for the years 2012 and 2013..so how can i use ur calcutions that can match with Quarter&amp;nbsp; and Week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 18:03:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551064#M205811</guid>
      <dc:creator>shree909</dc:creator>
      <dc:date>2014-01-03T18:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Week to week  and quarter to quarter comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551065#M205812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take inline&lt;/P&gt;&lt;P&gt;as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;week:&lt;/P&gt;&lt;P&gt;load *&lt;/P&gt;&lt;P&gt;inline [&lt;/P&gt;&lt;P&gt;Day,Week&lt;/P&gt;&lt;P&gt;1,1&lt;/P&gt;&lt;P&gt;2,1&lt;/P&gt;&lt;P&gt;3,1&lt;/P&gt;&lt;P&gt;4,1&lt;/P&gt;&lt;P&gt;5,1&lt;/P&gt;&lt;P&gt;6,1&lt;/P&gt;&lt;P&gt;7,1&lt;/P&gt;&lt;P&gt;8,2&lt;/P&gt;&lt;P&gt;9,2&lt;/P&gt;&lt;P&gt;10,2&lt;/P&gt;&lt;P&gt;11,2&lt;/P&gt;&lt;P&gt;12,2&lt;/P&gt;&lt;P&gt;13,2&lt;/P&gt;&lt;P&gt;14,2&lt;/P&gt;&lt;P&gt;15,3&lt;/P&gt;&lt;P&gt;16,3&lt;/P&gt;&lt;P&gt;17,3&lt;/P&gt;&lt;P&gt;18,3&lt;/P&gt;&lt;P&gt;19,3&lt;/P&gt;&lt;P&gt;20,3&lt;/P&gt;&lt;P&gt;21,3&lt;/P&gt;&lt;P&gt;22,4&lt;/P&gt;&lt;P&gt;23,4&lt;/P&gt;&lt;P&gt;24,4&lt;/P&gt;&lt;P&gt;25,4&lt;/P&gt;&lt;P&gt;26,4&lt;/P&gt;&lt;P&gt;27,4&lt;/P&gt;&lt;P&gt;28,4&lt;/P&gt;&lt;P&gt;29,4&lt;/P&gt;&lt;P&gt;30,4&lt;/P&gt;&lt;P&gt;31,4&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and apply mapp it or right join it to master calendar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then do&lt;/P&gt;&lt;P&gt;current week ---&amp;gt;sum({Year={'$(=max(Year))'},Month={'$(=Max(Monthnum))'},Week={'$(=max(Week)'},Date={'&amp;lt;=$(=Max(Date)'}}) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous week ---&amp;gt; sum({Year={'$(=max(Year))'},Month={'$(=Max(Monthnum))'},Week={'$(=max(Week)-1'},Date={'&amp;lt;=$(=Max(Date)'}}) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps you &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 18:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551065#M205812</guid>
      <dc:creator>preminqlik</dc:creator>
      <dc:date>2014-01-03T18:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Week to week  and quarter to quarter comparison</title>
      <link>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551066#M205813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create a master calendar that will generate all the dates. See this discussion: &lt;A href="https://community.qlik.com/thread/66717"&gt;Tutorial - Using Common Date Dimensions and Shared Calendars&lt;/A&gt;. If you use the QVC library to generate the master calendar you automagically some _*Serial fields too. Those are not meant to be used in listboxes, but only in expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try to explain the problem with the Q1, Q2 etc. Suppose you select 2013 and Q1. What's the previous quarter? It's not Q0. That doesn't exist. It's not possible to take a value from the Quarter field and subtract 1 from it to get the previous quarter. With a serial field this is possible. It will have for example values 1 for Q1-2012, 2 for Q2-2012, 3 for Q3-2012, 4 for Q4-2012 and 5 for Q1-2013. Now if you select 2013 in the year field and Q1 in the quarter field you should see only value 5 as possible value in the _QuarterSerial field. Since it's a numeric field you can subtract 1 from it: 5 - 1 = 4. And value 4 represents Q4-2012, which is indeed the previous quarter of Q1-2013.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 18:35:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Week-to-week-and-quarter-to-quarter-comparison/m-p/551066#M205813</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-01-03T18:35:21Z</dc:date>
    </item>
  </channel>
</rss>

