<?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: Successive count for each month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871310#M304610</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you give me one example script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jun 2015 10:56:38 GMT</pubDate>
    <dc:creator>jagannalla</dc:creator>
    <dc:date>2015-06-22T10:56:38Z</dc:date>
    <item>
      <title>Successive count for each month</title>
      <link>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871308#M304608</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've data like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;MonthYr&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Color&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;AccountId&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Apr 2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Red&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Apr 2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Red&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Apr 2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Green&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Apr 2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Green&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Apr 2015&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;May 2015&lt;/TD&gt;&lt;TD&gt;Red&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;May 2015&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;May 2015&lt;/TD&gt;&lt;TD&gt;Green&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jun 2015&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;9&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jun 2015&lt;/TD&gt;&lt;TD&gt;Green&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Jun 2015&lt;/TD&gt;&lt;TD&gt;Green&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need o/p:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="192"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="60" rowspan="3" width="64"&gt;Apr-15&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="64"&gt;Red&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-left: none;" width="64"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none; border-left: none;"&gt;Green&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none; border-left: none;"&gt;Yellow&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="60" rowspan="3" style="border-top: none;"&gt;15-May&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Red&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none; border-left: none;"&gt;Green&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none; border-left: none;"&gt;Yellow&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="60" rowspan="3" style="border-top: none;"&gt;Jun-15&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;Red&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none; border-left: none;"&gt;Green&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none; border-left: none;"&gt;Yellow&lt;/TD&gt;&lt;TD align="right" class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- The count of Red is based on start month to end month. from Apr to jun we had 3 reds, from May to Jun we had 2 and in jun we don't have any red's&lt;/P&gt;&lt;P&gt;- I want to use only 2 dimension with 1 exp (Dim are MonthYr,Color and exp as count(AccountId)&lt;/P&gt;&lt;P&gt;- Every thing needs to done in script level only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 10:23:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871308#M304608</guid>
      <dc:creator>jagannalla</dc:creator>
      <dc:date>2015-06-22T10:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Successive count for each month</title>
      <link>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871309#M304609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jagan, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the easiest way to do this is to setup one count for each color and the group the table load on Year-Month. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 10:34:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871309#M304609</guid>
      <dc:creator />
      <dc:date>2015-06-22T10:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: Successive count for each month</title>
      <link>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871310#M304610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you give me one example script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 10:56:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871310#M304610</guid>
      <dc:creator>jagannalla</dc:creator>
      <dc:date>2015-06-22T10:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Successive count for each month</title>
      <link>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871311#M304611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jagan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ColorTemp:&lt;/P&gt;&lt;P&gt;LOAD *, MonthYr&amp;amp;Color as ColorKey INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthYr, Color, AccountId&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Apr 2015, Red, 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Apr 2015, Red, 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Apr 2015, Green, 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Apr 2015, Green, 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Apr 2015, Yellow, 5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; May 2015, Red, 6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; May 2015, Yellow, 7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; May 2015, Green, 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jun 2015, Yellow, 9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jun 2015, Green, 10&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Jun 2015, Green, 11&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Cross Join&lt;/P&gt;&lt;P&gt;ColorTemp2:&lt;/P&gt;&lt;P&gt;LOAD Distinct MonthYr Resident ColorTemp;&lt;/P&gt;&lt;P&gt;Join LOAD Distinct Color Resident ColorTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Concatenate the missed color to corresponding month&lt;/P&gt;&lt;P&gt;Concatenate (ColorTemp)&lt;/P&gt;&lt;P&gt;LOAD MonthYr,Color Resident ColorTemp2 Where not Exists(ColorKey, MonthYr&amp;amp;Color) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table ColorTemp2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Field ColorKey;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Date format&lt;/P&gt;&lt;P&gt;Color:&lt;/P&gt;&lt;P&gt;LOAD *, Month(Date) as Month, Month(Date)*1 as MonthNum;&lt;/P&gt;&lt;P&gt;LOAD *, Date(Date#(MonthYr, 'MMM YYYY')) as Date Resident ColorTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table ColorTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Find the max month&lt;/P&gt;&lt;P&gt;MaxMonthTable:&lt;/P&gt;&lt;P&gt;LOAD Max(Month) as MaxMonth Resident Color;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMaxMonth = Peek('MaxMonth', 0, 'MaxMonthTable');&lt;/P&gt;&lt;P&gt;DROP Table MaxMonthTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Join the month from small to large&lt;/P&gt;&lt;P&gt;Join(Color)&lt;/P&gt;&lt;P&gt;load Distinct&lt;/P&gt;&lt;P&gt;Month as Month_AsOf,&lt;/P&gt;&lt;P&gt;MonthNum + IterNo()-1 as Month&lt;/P&gt;&lt;P&gt;Resident Color&lt;/P&gt;&lt;P&gt;while MonthNum+IterNo()-1 &amp;lt;= $(vMaxMonth);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//only for Red&lt;/P&gt;&lt;P&gt;FinalTable:&lt;/P&gt;&lt;P&gt;LOAD MonthYr, Color, AccountId, Month_AsOf as Month Resident Color Where Color = 'Red';&lt;/P&gt;&lt;P&gt;LOAD Distinct MonthYr, Color, AccountId, Month Resident Color Where Color &amp;lt;&amp;gt; 'Red';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Color;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXIT Script;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use Month&lt;SPAN style="font-size: 13.3333330154419px;"&gt;, Color&lt;/SPAN&gt; as Dimension. =Count(AccountId) as Measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 11:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871311#M304611</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2015-06-22T11:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: Successive count for each month</title>
      <link>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871312#M304612</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;Check the attached file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T1:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthYr,Color&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Apr 2015, Red&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apr 2015, Red&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apr 2015, Green&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apr 2015, Green&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apr 2015, Yellow&lt;/P&gt;&lt;P&gt;&amp;nbsp; Jun 2015, Yellow&lt;/P&gt;&lt;P&gt;&amp;nbsp; Jun 2015, Green&lt;/P&gt;&lt;P&gt;&amp;nbsp; Jun 2015, Green&lt;/P&gt;&lt;P&gt;&amp;nbsp; May 2015, Red&lt;/P&gt;&lt;P&gt;&amp;nbsp; May 2015, Yellow&lt;/P&gt;&lt;P&gt;&amp;nbsp; May 2015, Green&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;T2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; MonthYr,&lt;/P&gt;&lt;P&gt;&amp;nbsp; count(if(Color = 'Red',1)) as Red,&lt;/P&gt;&lt;P&gt;&amp;nbsp; count(if(Color = 'Yellow',1)) as Yellow,&lt;/P&gt;&lt;P&gt;&amp;nbsp; count(if(Color = 'Green',1)) as Green&lt;/P&gt;&lt;P&gt;Resident T1&lt;/P&gt;&lt;P&gt;Group By MonthYr;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 11:30:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871312#M304612</guid>
      <dc:creator />
      <dc:date>2015-06-22T11:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Successive count for each month</title>
      <link>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871313#M304613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please see the attached.&lt;/P&gt;&lt;P&gt;There only one red from May 2015 to Jun 2015 instead of two as you have mentioned.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jun 2015 11:55:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Successive-count-for-each-month/m-p/871313#M304613</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2015-06-22T11:55:05Z</dc:date>
    </item>
  </channel>
</rss>

