<?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 Count If in Group by Help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1691834#M450667</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I have a table with IDs and various statuses associated to those IDs. Some statuses are known as "final statuses" but there is no column signifying this.&lt;BR /&gt;&lt;BR /&gt;A final status can either be approved, rejected, or expired.&lt;BR /&gt;&lt;BR /&gt;I want to count how many times each ID goes through a Final Status.&lt;BR /&gt;&lt;BR /&gt;Here is what table currently looks like:&lt;/P&gt;&lt;TABLE width="301px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;ID&lt;/TD&gt;&lt;TD width="90.4px"&gt;Status&lt;/TD&gt;&lt;TD width="116px"&gt;Update Time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;123&lt;/TD&gt;&lt;TD width="90.4px"&gt;Pending&lt;/TD&gt;&lt;TD width="116px"&gt;1/1/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;123&lt;/TD&gt;&lt;TD width="90.4px"&gt;Expired&lt;/TD&gt;&lt;TD width="116px"&gt;1/30/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;123&lt;/TD&gt;&lt;TD width="90.4px"&gt;Approved&lt;/TD&gt;&lt;TD width="116px"&gt;2/4/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;456&lt;/TD&gt;&lt;TD width="90.4px"&gt;Pending&lt;/TD&gt;&lt;TD width="116px"&gt;1/4/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;456&lt;/TD&gt;&lt;TD width="90.4px"&gt;Rejected&lt;/TD&gt;&lt;TD width="116px"&gt;1/16/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;789&lt;/TD&gt;&lt;TD width="90.4px"&gt;Pending&lt;/TD&gt;&lt;TD width="116px"&gt;1/24/2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;And here is what i need it to look like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE width="260px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="84.8px"&gt;ID&lt;/TD&gt;&lt;TD width="174.4px"&gt;Count of Final Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="84.8px"&gt;123&lt;/TD&gt;&lt;TD width="174.4px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="84.8px"&gt;456&lt;/TD&gt;&lt;TD width="174.4px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="84.8px"&gt;789&lt;/TD&gt;&lt;TD width="174.4px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know i would have to do a group by but confused how to proceed, given that I'm counting for various items in the same field. any help would be appreciated, thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 08 Apr 2020 03:55:31 GMT</pubDate>
    <dc:creator>Panv</dc:creator>
    <dc:date>2020-04-08T03:55:31Z</dc:date>
    <item>
      <title>Count If in Group by Help</title>
      <link>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1691834#M450667</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;&lt;BR /&gt;I have a table with IDs and various statuses associated to those IDs. Some statuses are known as "final statuses" but there is no column signifying this.&lt;BR /&gt;&lt;BR /&gt;A final status can either be approved, rejected, or expired.&lt;BR /&gt;&lt;BR /&gt;I want to count how many times each ID goes through a Final Status.&lt;BR /&gt;&lt;BR /&gt;Here is what table currently looks like:&lt;/P&gt;&lt;TABLE width="301px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;ID&lt;/TD&gt;&lt;TD width="90.4px"&gt;Status&lt;/TD&gt;&lt;TD width="116px"&gt;Update Time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;123&lt;/TD&gt;&lt;TD width="90.4px"&gt;Pending&lt;/TD&gt;&lt;TD width="116px"&gt;1/1/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;123&lt;/TD&gt;&lt;TD width="90.4px"&gt;Expired&lt;/TD&gt;&lt;TD width="116px"&gt;1/30/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;123&lt;/TD&gt;&lt;TD width="90.4px"&gt;Approved&lt;/TD&gt;&lt;TD width="116px"&gt;2/4/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;456&lt;/TD&gt;&lt;TD width="90.4px"&gt;Pending&lt;/TD&gt;&lt;TD width="116px"&gt;1/4/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;456&lt;/TD&gt;&lt;TD width="90.4px"&gt;Rejected&lt;/TD&gt;&lt;TD width="116px"&gt;1/16/2020&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="93.6px"&gt;789&lt;/TD&gt;&lt;TD width="90.4px"&gt;Pending&lt;/TD&gt;&lt;TD width="116px"&gt;1/24/2020&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;And here is what i need it to look like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE width="260px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="84.8px"&gt;ID&lt;/TD&gt;&lt;TD width="174.4px"&gt;Count of Final Status&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="84.8px"&gt;123&lt;/TD&gt;&lt;TD width="174.4px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="84.8px"&gt;456&lt;/TD&gt;&lt;TD width="174.4px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="84.8px"&gt;789&lt;/TD&gt;&lt;TD width="174.4px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know i would have to do a group by but confused how to proceed, given that I'm counting for various items in the same field. any help would be appreciated, thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 03:55:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1691834#M450667</guid>
      <dc:creator>Panv</dc:creator>
      <dc:date>2020-04-08T03:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count If in Group by Help</title>
      <link>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1691841#M450670</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;for this the best approach will be to add a new field in your load script&amp;nbsp;&lt;/P&gt;&lt;P&gt;the field will be added using this expression&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;if (match(Status,'approved', 'rejected', 'expired')&amp;gt;0,1,0) as FinalStatusFlag &lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;then you will use a simple function in your table&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sum(FinalStatusFlag)&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;but you can also use this expression in the table directly&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sum(if (match(Status,'approved', 'rejected', 'expired')&amp;gt;0,1,0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 05:13:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1691841#M450670</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2020-04-08T05:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count If in Group by Help</title>
      <link>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1691970#M450686</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can use set analysis for this like:&lt;/P&gt;&lt;P&gt;Count({$&amp;lt;Status={'Expired','Approved','Rejected'}&amp;gt;} Status)&lt;/P&gt;&lt;P&gt;hope this help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 11:47:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1691970#M450686</guid>
      <dc:creator>usamabinsadiq</dc:creator>
      <dc:date>2020-04-08T11:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count If in Group by Help</title>
      <link>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1697821#M451039</link>
      <description>&lt;P&gt;You have received two replies, please be sure to close out your thread by using the Accept as Solution button on the reply that helped you with your question.&amp;nbsp; If you did something different, you can post that and then use the button to mark that.&amp;nbsp; This provides the posters credit for the help and lets the other Members know what worked for the use case.&amp;nbsp; Please be sure to return to the thread and close it out if possible, it is greatly appreciated.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 15:45:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1697821#M451039</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-04-29T15:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Count If in Group by Help</title>
      <link>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1698218#M451060</link>
      <description>&lt;P&gt;One solution:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;tab1:
LOAD ID, Count(If(Match(Status,'Approved', 'Rejected', 'Expired'),ID)) As [Count of Final Status]
Group By ID
;
LOAD * INLINE [
    ID, Status, Update Time
    123, Pending, 1/1/2020
    123, Expired, 1/30/2020
    123, Approved, 2/4/2020
    456, Pending, 1/4/2020
    456, Rejected, 1/16/2020
    789, Pending, 1/24/2020
];&lt;/LI-CODE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="commQV33.PNG" style="width: 162px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/32765iD3C8AA0D9A8B15E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="commQV33.PNG" alt="commQV33.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 00:48:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-If-in-Group-by-Help/m-p/1698218#M451060</guid>
      <dc:creator>Saravanan_Desingh</dc:creator>
      <dc:date>2020-05-01T00:48:05Z</dc:date>
    </item>
  </channel>
</rss>

