<?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: Count based on group condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810228#M1037421</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HEy,&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;Status = {'Open'}&amp;gt;}ServiceNumber) - Count({&amp;lt;Status = {'Close'}&amp;gt;}ServiceNumber)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jan 2015 09:23:17 GMT</pubDate>
    <dc:creator>nikhilgarg</dc:creator>
    <dc:date>2015-01-19T09:23:17Z</dc:date>
    <item>
      <title>Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810223#M1037412</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;Say I have the following dataset:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); 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;ServiceNumber&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Status&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;CloseDate&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;1234&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Open&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1234&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Close&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8 Jan 2015&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3456&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Open&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to get a count of all ServiceNumbers that are still open, and have not been closed. In this case, the answer should be 1 (for service number 3456). How can I do this in set analysis expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:03:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810223#M1037412</guid>
      <dc:creator />
      <dc:date>2015-01-19T09:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810224#M1037413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Count(Distinct{&amp;lt;Status={'Open'}&amp;gt;} ServeiceNumber)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:17:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810224#M1037413</guid>
      <dc:creator>sunilkumarqv</dc:creator>
      <dc:date>2015-01-19T09:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810225#M1037414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;count({&amp;lt;Status={'Open'}&amp;gt;}ServiceNumber)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:18:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810225#M1037414</guid>
      <dc:creator>arulsettu</dc:creator>
      <dc:date>2015-01-19T09:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810226#M1037415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This gives 2. I only want to count the Service Number that has not been closed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:19:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810226#M1037415</guid>
      <dc:creator />
      <dc:date>2015-01-19T09:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810227#M1037417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;based on the data you have two open servicenumbers 1234,3456 so the result is 2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:22:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810227#M1037417</guid>
      <dc:creator>arulsettu</dc:creator>
      <dc:date>2015-01-19T09:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810228#M1037421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HEy,&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count({&amp;lt;Status = {'Open'}&amp;gt;}ServiceNumber) - Count({&amp;lt;Status = {'Close'}&amp;gt;}ServiceNumber)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:23:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810228#M1037421</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-01-19T09:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810229#M1037424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This can be a work around, however is there a way I can actually group it by the SR number while counting? Because there may be some Service Numbers that are immediately classified as 'Closed' without a matching 'Open', so this will skew the numbers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 09:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810229#M1037424</guid>
      <dc:creator />
      <dc:date>2015-01-19T09:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810230#M1037428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok i will let you know. I&amp;nbsp; m working on this....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 10:17:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810230#M1037428</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-01-19T10:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810231#M1037431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Try this:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;if(Count({&amp;lt;Status = {'Close'},CloseDate-={"=len(trim(CloseDate))=0}"}&amp;gt;}ServiceNumber)-Count({&amp;lt;Status = {'Open'}&amp;gt;}ServiceNumber)=-1,1,0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 11:15:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810231#M1037431</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2015-01-19T11:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810232#M1037435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can count only that ServiceNumber which comes only one time in your table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 11:35:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810232#M1037435</guid>
      <dc:creator>tyagishaila</dc:creator>
      <dc:date>2015-01-19T11:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810233#M1037438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if the Status was "Close"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 11:40:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810233#M1037438</guid>
      <dc:creator>robert_mika</dc:creator>
      <dc:date>2015-01-19T11:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810234#M1037442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If Status was close than at any time it was opened also.. Only open store can close..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes its not perfect way to count Service Number .. I just gave an idea..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 12:01:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810234#M1037442</guid>
      <dc:creator>tyagishaila</dc:creator>
      <dc:date>2015-01-19T12:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810235#M1037446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HEy, &lt;/P&gt;&lt;P&gt;Here it is . Try this and let me know:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count(Aggr(Count(DISTINCT ServiceNumbers),ServiceNumbers)) - Count(Aggr(Count({&amp;lt;Status = {'Close'}&amp;gt;}DISTINCT ServiceNumbers), ServiceNumbers))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 12:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810235#M1037446</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-01-19T12:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810236#M1037448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow! This works perfectly thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's also another way that my colleague suggested: &lt;/P&gt;&lt;P&gt;count({&amp;lt;Status={'Open'}, ServiceNumber-=P({&amp;lt;Status={'Close'}&amp;gt;})&amp;gt;}ServiceNumber)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 01:55:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810236#M1037448</guid>
      <dc:creator />
      <dc:date>2015-01-20T01:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810237#M1037449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;But when i tried your given expression it is showing me error. IS it working fine in your case ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;count({&amp;lt;Status={'Open'}, ServiceNumber-=P({&amp;lt;Status={'Close'}&amp;gt;})&amp;gt;}ServiceNumber)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 08:37:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810237#M1037449</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-01-20T08:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810238#M1037450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It does show a syntax error (red underline), but the expression calculates fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 08:43:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810238#M1037450</guid>
      <dc:creator />
      <dc:date>2015-01-20T08:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Count based on group condition</title>
      <link>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810239#M1037451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Hey,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;Yeah i see to it . BTW can you tell me how the following function working?? I mean what does it ouputs ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f6f6f6;"&gt;ServiceNumber-=P({&amp;lt;Status={'Close'}&amp;gt;})&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Jan 2015 08:51:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-based-on-group-condition/m-p/810239#M1037451</guid>
      <dc:creator>nikhilgarg</dc:creator>
      <dc:date>2015-01-20T08:51:55Z</dc:date>
    </item>
  </channel>
</rss>

