<?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: Calculating the quarter difference for the same customer in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081851#M926501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like q3 -  Q1= 2q.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 2q is quarter difference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sent from Outlook Mobile&amp;lt;https://aka.ms/blhgte&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Mar 2016 06:34:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-03-29T06:34:24Z</dc:date>
    <item>
      <title>Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081847#M926497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following scripts and dataset as follow and now i need to find the quarter difference for the same customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone advise me how to get the quarter difference and what should i add on?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image" src="https://community.qlik.com/legacyfs/online/119571_QlikCommunity_Thread_210630_Pic1.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL class="dp-c" start="1"&gt;&lt;LI&gt;SET ThousandSep=',';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET DecimalSep='.';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET MoneyThousandSep=',';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET MoneyDecimalSep='.';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET MoneyFormat='$#,##0.00;($#,##0.00)';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET TimeFormat='h:mm:ss TT';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET DateFormat='DD-MM-YY';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET TimestampFormat='DD-MM-YY h:mm:ss[.fff] TT';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET FirstWeekDay=6;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET BrokenWeeks=1;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET ReferenceDay=0;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET FirstMonthOfYear=1;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;SET CollationLocale='en-US';&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;table1:&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;LOAD Date(MonthStart(Date#(ScreeningMonth, 'MMM-YY')), 'MMM-YY') as ScreeningMonth,&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;ScreeningQtr;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;LOAD * Inline [&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScreeningMonth, ScreeningQtr&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Apr-15, Q1&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; May-15, Q1&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jun-15, Q1&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jul-15, Q2&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Aug-15, Q2&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sep-15, Q2&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Oct-15, Q3&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nov-15, Q3&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dec-15, Q3&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;];&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;table2:&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;LOAD [S/N],&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer,&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScreeningDate,&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(MonthStart(ScreeningDate), 'MMM-YY') as ScreeningMonth&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;from XXXX&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081847#M926497</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081848#M926498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is the "the quarter difference" defined for a given customer?&lt;/P&gt;&lt;P&gt;When looking at your sample table, a Customer can show multiple records, so what is "the difference" in these cases?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, what about a date range spanning multiple years, how do you want to handle this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible, post some sample records and your requested result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And last, have you had a look at my last reply to your other thread?&lt;/P&gt;&lt;P&gt;It seems to me that you are basically posting multiple times the same request, which is not a good idea, since it makes it hard to follow the discussion and further clutters the forum with duplicate topics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Mar 2016 17:48:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081848#M926498</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-28T17:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081849#M926499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try This:&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG&gt;in script add:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;dual(year(OrderDate)&amp;amp;'Q'&amp;amp;Ceil(Month(OrderDate)/3),QuarterStart(OrderDate))as MyQuarter,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG&gt;Create straight table:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG&gt;Dimension as&lt;/STRONG&gt; Customer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG&gt;Expression as&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Curr Q Sales =Sum(Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;Pre Q Sales = Sum({1&amp;lt;MyQuarter={"$(=dual(year(max(OrderDate))&amp;amp;'Q'&amp;amp;Ceil((Month(max(OrderDate))/3)-1),QuarterStart(max(OrderDate))))"}&amp;gt;}Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2016 06:09:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081849#M926499</guid>
      <dc:creator>amayuresh</dc:creator>
      <dc:date>2016-03-29T06:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081850#M926500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean by "quarter difference" here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2016 06:16:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081850#M926500</guid>
      <dc:creator>tyagishaila</dc:creator>
      <dc:date>2016-03-29T06:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081851#M926501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like q3 -  Q1= 2q.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 2q is quarter difference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sent from Outlook Mobile&amp;lt;https://aka.ms/blhgte&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2016 06:34:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081851#M926501</guid>
      <dc:creator />
      <dc:date>2016-03-29T06:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081852#M926502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using below expression&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;STRONG style=": ; color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;Curr Q Sales&lt;/STRONG&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; color: #575757; font-size: 10pt;"&gt; =Sum(Sales)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #575757; font-style: inherit; font-size: 10pt; font-family: arial, helvetica, sans-serif; font-weight: inherit;"&gt;&lt;STRONG&gt;Pre Q Sales&lt;/STRONG&gt; = Sum({1&amp;lt;MyQuarter={"$(=dual(year(max(OrderDate))&amp;amp;'Q'&amp;amp;Ceil((Month(max(OrderDate))/3)-1),QuarterStart(max(OrderDate))))"}&amp;gt;}Sales)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 03:00:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081852#M926502</guid>
      <dc:creator>amayuresh</dc:creator>
      <dc:date>2016-03-30T03:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081853#M926503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tab:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScreeningQtr, Customer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3, A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3, B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3, C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3, D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3, E&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3, F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q3, A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q2, B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1, C&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q2, D&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1, E&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1, F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1, A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q1, B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q2, C&lt;/P&gt;&lt;P&gt;] ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&amp;nbsp; If(Previous(Customer) = Customer ,right(ScreeningQtr,1)-Right(Previous(ScreeningQtr),1), right(ScreeningQtr,1)) As QtrNo &lt;/P&gt;&lt;P&gt;Resident Tab Order by Customer, ScreeningQtr asc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Tab;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 05:13:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081853#M926503</guid>
      <dc:creator>tyagishaila</dc:creator>
      <dc:date>2016-03-30T05:13:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081854#M926504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot define another inline using customers as the customer list is too many and will grow over the time.&lt;/P&gt;&lt;P&gt;i have tried to identify the diff between the same customer.&lt;/P&gt;&lt;P&gt;However, the below script failed. anyone can advise, pls?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(previous([Customer]) = [Customer], ceil((ScreeningQtr - Previous(ScreeningQtr)))) As Diff;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;Resident Table2&lt;/P&gt;&lt;P&gt;Order by [Customer], ScreeningQtr;&lt;/P&gt;&lt;P&gt;Drop Table Table2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2016 02:24:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081854#M926504</guid>
      <dc:creator />
      <dc:date>2016-04-27T02:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating the quarter difference for the same customer</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081855#M926505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to find the quarter difference for the same customer.&lt;/P&gt;&lt;P&gt;for example Customer A - Q3 and Customer A - Q7&lt;/P&gt;&lt;P&gt;the quarter difference for Customer A shall be 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Able to advise, pls.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Apr 2016 03:14:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-the-quarter-difference-for-the-same-customer/m-p/1081855#M926505</guid>
      <dc:creator />
      <dc:date>2016-04-27T03:14:44Z</dc:date>
    </item>
  </channel>
</rss>

