<?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: Calculation to include the previous quarter for each column in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1788692#M1210333</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/58578"&gt;@edwin&lt;/a&gt;&amp;nbsp;, thank you so much! That's perfect and really useful, you're a superstar - thanks again! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Mar 2021 13:54:10 GMT</pubDate>
    <dc:creator>Dayna</dc:creator>
    <dc:date>2021-03-05T13:54:10Z</dc:date>
    <item>
      <title>Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1787066#M1210166</link>
      <description>&lt;P&gt;Good Afternoon All,&lt;/P&gt;&lt;P&gt;I'm looking to create a report which is based on quarters, and I'm not entirely sure how to start here (other than it being set analysis!) where I want to refer to the previous quarter in each column.&lt;/P&gt;&lt;P&gt;So for example, I may have selected to see Q1&amp;nbsp;2020 - through to Q1 2021, and what I want to see is the following columns:&lt;/P&gt;&lt;P&gt;Q1 2020 + Previous (Q4 2019)&amp;nbsp;&lt;/P&gt;&lt;P&gt;Q2 2020 + Previous (Q1 2020)&lt;/P&gt;&lt;P&gt;Q3 2020 + Previous (Q2 2020)&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got this for showing the last year based on selected, but I'll have multiple quarters selected (or showing everything by default). What do you suggest?&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;Year={$(=Only(Year)-1)}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 13:46:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1787066#M1210166</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2021-03-01T13:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1787184#M1210179</link>
      <description>&lt;P&gt;one solution is to create a bridge between your fact and your calendar.&amp;nbsp; you associate a quarter in your calendar to the same quarter in your fact plus the prior quarter&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this way when you select a quarter from your calendar you automatically select two quarters in your fact and the expression is just sum(Sales):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1614622950596.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/50140i7320BF845845FA51/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1614622950596.png" alt="edwin_0-1614622950596.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 18:25:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1787184#M1210179</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-01T18:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1787187#M1210180</link>
      <description>&lt;P&gt;the first chart shows the actual sales per quarter from the fact table,&amp;nbsp; the 2nd chart shows the sum of current + prior quarter per calendar quarter.&amp;nbsp; this is the validation from excel:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_1-1614623277236.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/50141iA169B07FB0EAA058/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_1-1614623277236.png" alt="edwin_1-1614623277236.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 18:28:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1787187#M1210180</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-01T18:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1787190#M1210182</link>
      <description>&lt;P&gt;you of course will want to use your quarter nomenclature, just tweak the script that builds the bridge.&amp;nbsp; the bridge only addresses the requirement for summing current and prior quarters and is identified by the date type.&amp;nbsp; if there are other requirements where the user selects a date from the calendar and a different rule for summing by date is needed then the bridge needs to be expanded to account for that requirement&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;to preserve the expression fro the quarters you now have to identify the data type from the bridge you are using:&lt;BR /&gt;&lt;BR /&gt;=sum({&amp;lt;DateType={'CURRENT+PRIORQUARTERS'} &amp;gt;}Sales)&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 18:38:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1787190#M1210182</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-01T18:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1788692#M1210333</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/58578"&gt;@edwin&lt;/a&gt;&amp;nbsp;, thank you so much! That's perfect and really useful, you're a superstar - thanks again! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 13:54:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1788692#M1210333</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2021-03-05T13:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1788698#M1210334</link>
      <description>&lt;P&gt;yw&lt;/P&gt;</description>
      <pubDate>Fri, 05 Mar 2021 14:04:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1788698#M1210334</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-05T14:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1789723#M1210478</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/58578"&gt;@edwin&lt;/a&gt;, hoping you can help me one last time...&lt;/P&gt;&lt;P&gt;I've replicated the solution you gave me into my report, I need to show the previous quarter value within a straight table along with other values. The field for the quarter would be the one from the data table including the sales, not the CalendarQuarter.&lt;/P&gt;&lt;P&gt;I only get the correct value (i.e. the sum of the quarter and previous) when I used the CalendarQuarter as my dimension. How would I get this value, but use the data table Quarter dimension?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;Dayna&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 16:34:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1789723#M1210478</guid>
      <dc:creator>Dayna</dc:creator>
      <dc:date>2021-03-09T16:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1789735#M1210480</link>
      <description>&lt;P&gt;the bridge is just that - a way to get to your data from the calendar.&amp;nbsp; so if with the new business rules, you need an association between each calendar date and the date in your fact that is 1 to 1.&amp;nbsp; just add a new data type in your bridge.&amp;nbsp; and now since you have two data types you need to qualify in your expressions which data type you want to use.&amp;nbsp; if in your expression you want current + prior quarter you use datatype=CURRENT+PRIORS (i named it such so its clear to you - you can always invent your own convention) so if you wan to show just the current quarter, still use the calendar dates/quarters but this time use datatype=CURRENT.&amp;nbsp; see attached&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 17:15:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1789735#M1210480</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-03-09T17:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation to include the previous quarter for each column</title>
      <link>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1984510#M1221149</link>
      <description>&lt;P&gt;data:&lt;BR /&gt;load date(today()-iterno()+1) as Date, QuarterName(date(today()-iterno()+1)) as Quarter, floor(rand()*1000) as Sales&lt;BR /&gt;while iterno()&amp;lt;=365;&lt;BR /&gt;load 1 AutoGenerate(1);&lt;/P&gt;
&lt;P&gt;calendar: load distinct Quarter as CalendarQuarter, Date as CalendarDate Resident data;&lt;/P&gt;
&lt;P&gt;tmpQuarters: load distinct CalendarQuarter Resident calendar;&lt;/P&gt;
&lt;P&gt;inner join (calendar) load CalendarQuarter, RowNo()-1 as CalendarQuarterIndex Resident tmpQuarters;&lt;/P&gt;
&lt;P&gt;drop table tmpQuarters;&lt;/P&gt;
&lt;P&gt;NoConcatenate tmpBridge: load distinct CalendarQuarterIndex, CalendarDate Resident calendar;&lt;BR /&gt;inner join (tmpBridge) load CalendarQuarterIndex as QuarterIndex, CalendarDate as Date Resident tmpBridge;&lt;/P&gt;
&lt;P&gt;NoConcatenate Bridge: load CalendarDate, Date, 'CURRENT+PRIORQUARTERS' as DateType resident tmpBridge&lt;BR /&gt;where QuarterIndex=CalendarQuarterIndex &lt;BR /&gt;or QuarterIndex=CalendarQuarterIndex+1;&lt;/P&gt;
&lt;P&gt;drop table tmpBridge;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 04:51:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculation-to-include-the-previous-quarter-for-each-column/m-p/1984510#M1221149</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2022-09-23T04:51:03Z</dc:date>
    </item>
  </channel>
</rss>

