<?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 ID based on field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815015#M1212928</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I have ID, Date, MonthYear and Status as fields.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. I have to count all the IDs that have more than one Running or Pending or Complete Status&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. I also have to count&amp;nbsp;&lt;SPAN&gt;IDs that have more than one Running or Pending or Complete Status and fall within one year from the Date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For problem 1,&amp;nbsp; I am using&amp;nbsp;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;ID = {"=Count({&amp;lt;Status = {'Running', 'Complete', 'Pending'}&amp;gt;} Status) &amp;gt; 1"}&amp;gt;} ID)&amp;nbsp;&lt;/STRONG&gt;but this also counts other ID rows with other Status values.&lt;/P&gt;&lt;P&gt;For problem 2, I am using&amp;nbsp;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;ID = {"=Count({&amp;lt;Status = {'Completed'},MonthYear ={"&amp;gt;=$(=MonthName(addmonths(today(),-12)))"}&amp;gt;} Status) &amp;gt; 1"}&amp;gt;} ID)&amp;nbsp;&lt;/STRONG&gt;but this does not work either. The Set expression starts treating everything after 'MonthYear' as some kind of variable and gives errors.&lt;/P&gt;&lt;P&gt;I am attaching my QVW with some sample data. I have reached out before but couldn't really find the end solution for these 2 requirements. So reposting for bumping this question up. Any kind of help is highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Jun 2021 23:52:36 GMT</pubDate>
    <dc:creator>qlikwiz123</dc:creator>
    <dc:date>2021-06-14T23:52:36Z</dc:date>
    <item>
      <title>Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815015#M1212928</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have ID, Date, MonthYear and Status as fields.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. I have to count all the IDs that have more than one Running or Pending or Complete Status&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. I also have to count&amp;nbsp;&lt;SPAN&gt;IDs that have more than one Running or Pending or Complete Status and fall within one year from the Date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For problem 1,&amp;nbsp; I am using&amp;nbsp;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;ID = {"=Count({&amp;lt;Status = {'Running', 'Complete', 'Pending'}&amp;gt;} Status) &amp;gt; 1"}&amp;gt;} ID)&amp;nbsp;&lt;/STRONG&gt;but this also counts other ID rows with other Status values.&lt;/P&gt;&lt;P&gt;For problem 2, I am using&amp;nbsp;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;ID = {"=Count({&amp;lt;Status = {'Completed'},MonthYear ={"&amp;gt;=$(=MonthName(addmonths(today(),-12)))"}&amp;gt;} Status) &amp;gt; 1"}&amp;gt;} ID)&amp;nbsp;&lt;/STRONG&gt;but this does not work either. The Set expression starts treating everything after 'MonthYear' as some kind of variable and gives errors.&lt;/P&gt;&lt;P&gt;I am attaching my QVW with some sample data. I have reached out before but couldn't really find the end solution for these 2 requirements. So reposting for bumping this question up. Any kind of help is highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Jun 2021 23:52:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815015#M1212928</guid>
      <dc:creator>qlikwiz123</dc:creator>
      <dc:date>2021-06-14T23:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815120#M1212939</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;Count(DISTINCT {&amp;lt;Status = {'Running', 'Complete', 'Pending'}&amp;gt;} ID)&lt;/P&gt;&lt;P&gt;Count(DISTINCT {&amp;lt;Status = {'Complete'},Date ={"&amp;gt;=$(=MonthStart(addmonths(today(),-12)))"}&amp;gt;}ID)&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 08:50:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815120#M1212939</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-06-15T08:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815145#M1212940</link>
      <description>&lt;P&gt;for problem 1&lt;/P&gt;&lt;P&gt;sum(if(aggr(&lt;SPAN&gt;Count({&amp;lt;Status = {'Running', 'Complete', 'Pending'}&amp;gt;} ID),ID)&amp;gt;1,1,0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For problem 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum(if(aggr(Count({&amp;lt;Status = {'Complete'},Date ={"&amp;gt;=$(=MonthStart(addmonths(today(),-12)))"}&amp;gt;}ID),ID)&amp;gt;1,1,0))&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 10:49:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815145#M1212940</guid>
      <dc:creator>yassinemhadhbi</dc:creator>
      <dc:date>2021-06-15T10:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815261#M1212953</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1 is failing&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qlikwiz123_0-1623767825853.png" style="width: 800px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/56846iEFE6D13B5946CCEB/image-dimensions/800x108?v=v2" width="800" height="108" role="button" title="qlikwiz123_0-1623767825853.png" alt="qlikwiz123_0-1623767825853.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is counting even though there is only one Complete and one Running. It should be Count if (Status=Complete or Running or Pending) occurs more than once per SID.&lt;/P&gt;&lt;P&gt;In simple terms, count SID if Count(Status=Running) &amp;gt;1 or Count(Status=Pending)&amp;gt;1 or Count(Status=Complete)&amp;gt;1&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:39:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815261#M1212953</guid>
      <dc:creator>qlikwiz123</dc:creator>
      <dc:date>2021-06-15T14:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815264#M1212954</link>
      <description>&lt;P&gt;Can you please remove the &lt;STRONG&gt;Status&lt;/STRONG&gt; from the dimension&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:42:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815264#M1212954</guid>
      <dc:creator>yassinemhadhbi</dc:creator>
      <dc:date>2021-06-15T14:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815269#M1212955</link>
      <description>&lt;P&gt;Removed. Still see the count for ID&amp;nbsp;A560591&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qlikwiz123_0-1623768529160.png" style="width: 860px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/56848i0FEB1233E020CFB5/image-dimensions/860x117?v=v2" width="860" height="117" role="button" title="qlikwiz123_0-1623768529160.png" alt="qlikwiz123_0-1623768529160.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:49:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815269#M1212955</guid>
      <dc:creator>qlikwiz123</dc:creator>
      <dc:date>2021-06-15T14:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815277#M1212958</link>
      <description>&lt;P&gt;Please , try this :&amp;nbsp;&lt;/P&gt;&lt;P&gt;sum(if(aggr(Count({&amp;lt;Status = {'Running', 'Complete', 'Pending'}&amp;gt;}ID),ID,Status)&amp;gt;1,1,0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:00:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815277#M1212958</guid>
      <dc:creator>yassinemhadhbi</dc:creator>
      <dc:date>2021-06-15T15:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815280#M1212959</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qlikwiz123_0-1623769627605.png" style="width: 1092px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/56849i01E11AEC1705667F/image-dimensions/1092x154?v=v2" width="1092" height="154" role="button" title="qlikwiz123_0-1623769627605.png" alt="qlikwiz123_0-1623769627605.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Still does not work.&lt;/P&gt;&lt;P&gt;The ID is being counted twice here. It should be counted only once if it satisfies the conditon.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:08:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815280#M1212959</guid>
      <dc:creator>qlikwiz123</dc:creator>
      <dc:date>2021-06-15T15:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815282#M1212961</link>
      <description>&lt;P&gt;count(distinct if(aggr(Count({&amp;lt;Status = {'Running', 'Complete', 'Pending'}&amp;gt;}ID),ID,Status)&amp;gt;1,1))&lt;/P&gt;&lt;P&gt;Just replace the sum with Count&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:15:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815282#M1212961</guid>
      <dc:creator>yassinemhadhbi</dc:creator>
      <dc:date>2021-06-15T15:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815286#M1212963</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This seems to be working in a table with ID as dimension.&lt;/P&gt;&lt;P&gt;How do I show this number in a text box?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:25:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815286#M1212963</guid>
      <dc:creator>qlikwiz123</dc:creator>
      <dc:date>2021-06-15T15:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815291#M1212964</link>
      <description>&lt;P&gt;Try this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;=sum(&lt;/P&gt;&lt;P&gt;aggr(count(distinct if(aggr(Count({&amp;lt;Status = {'Running', 'Complete', 'Pending'}&amp;gt;}ID),ID,Status)&amp;gt;1,1)),ID)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 15:40:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1815291#M1212964</guid>
      <dc:creator>yassinemhadhbi</dc:creator>
      <dc:date>2021-06-15T15:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Count ID based on field</title>
      <link>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1817122#M1213096</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/80731"&gt;@yassinemhadhbi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi, really appreciate your help&lt;/P&gt;&lt;P&gt;Unfortunately, I discovered an issue with the expressions you have given expressions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;ID = {"=Count({&amp;lt;Status = {'Complete'},[Type]={'Primary'}&amp;gt;} Status) &amp;gt; 1"}, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Status={'Complete'},MonthYear ={"&amp;gt;=$(=MonthName(addmonths(today(),-12)))"}&amp;gt;} DISTINCT ID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This is supposed to count IDs if they have more than one 'Complete' status, Type as 'Primary' and MonthYear is within rollign 12 months (which means anything from June 2020 to June 2021). But this is also counting IDs in May 2020. I think it is because we are not doing MonthYear check in the 2nd count expression.&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I add it as below, it shows as invalid expression&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(DISTINCT {&amp;lt;ID = {"=Count({&amp;lt;Status = {'Complete'},[Type]={'Primary'},&lt;FONT color="#FF0000"&gt;MonthYear ={"&amp;gt;=$(=MonthName(addmonths(today(),-12)))"}&lt;/FONT&gt;&amp;gt;} Status) &amp;gt; 1"}, &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Status={'Complete'},MonthYear ={"&amp;gt;=$(=MonthName(addmonths(today(),-12)))"}&amp;gt;} DISTINCT ID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qlikwiz123_0-1624387450727.png" style="width: 734px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57369iB05750B8DECD9665/image-dimensions/734x26?v=v2" width="734" height="26" role="button" title="qlikwiz123_0-1624387450727.png" alt="qlikwiz123_0-1624387450727.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 18:44:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-ID-based-on-field/m-p/1817122#M1213096</guid>
      <dc:creator>qlikwiz123</dc:creator>
      <dc:date>2021-06-22T18:44:30Z</dc:date>
    </item>
  </channel>
</rss>

