<?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: Using a field within E() set modifier and the aggregation count. in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473514#M99892</link>
    <description>&lt;P&gt;Hi Samuel,&lt;/P&gt;
&lt;P&gt;Thank you for the reply! I fear I was clear in my post, allow me to try and correct that.&lt;/P&gt;
&lt;P&gt;I meant that I have two KPIs, one that counts workers and one that counts cases. Rereading my post, I see how that reads as if I have one that does both, what I get for posting at the end of the work day!&lt;/P&gt;
&lt;P&gt;That being said, I appreciated your suggested set analysis. I replaced the E() part with just "&lt;SPAN&gt;completion_date-={"*"}" (minus sign for not equals to in order to exclude anything with a completion data) but this just now returns zero?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;My confusion stems from the fact that this KPI doesn't respond when a case ID is selected:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;case_type={'X','Y'}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;,case_id=E({1&amp;lt;completion_date={"*"}&amp;gt;})&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Distinct case_id)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But this one does:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;&lt;BR /&gt;case_type={'X','Y'}&lt;BR /&gt;,case_id=E({1&amp;lt;completion_date={"*"}&amp;gt;})&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Distinct worker_id)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My suspicion is because the case_id is used in the E() term where as worker_id is not. As I said, trying to use a different field in the E() term returns zero so I'm a bit stuck. I would appreciate any insight into this!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jul 2024 10:46:05 GMT</pubDate>
    <dc:creator>Lobby</dc:creator>
    <dc:date>2024-07-29T10:46:05Z</dc:date>
    <item>
      <title>Using a field within E() set modifier and the aggregation count.</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2472873#M99824</link>
      <description>&lt;P&gt;Hi all, thank you for your support in advance! Some background about my data (unfortunately cannot share) :&lt;/P&gt;
&lt;P&gt;I have a data model of work cases, the fields include worker_id, case ID, case type, start date, and completion date. If the case hasn't been started or completed, those fields will be null values. If a case has been open for a month and isn't completed it is 'overdue'. I am not the app owner so limited control.&lt;/P&gt;
&lt;P&gt;My objective is to create a dashboard that has a table listing all cases that do not have a completion date and a KPI that counts the number of cases and the number of workers. I have used set analysis and the functions P() and E() to successfully create the API. Specifically:&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;&lt;BR /&gt;case_type={'X','Y'}&lt;BR /&gt;,case_id=E({1&amp;lt;completion_date={"*"}&amp;gt;})&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Distinct case_id)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above code works to count the number of cases and I replace the case_id at the end with worker_id to get the count of workers. However, I noticed that when I select a single case, the case-count KPI reflects the total count of cases still where as the worker-count KPI changes to reflect the manual selection I have made. I am trying to get both to reflect manual selections made. I tried removing the 1 in my E() function which made no difference and I have tried using a different field to equate to my E() - i.e&amp;nbsp;case_type=E({1&amp;lt;completion_date={"*"}&amp;gt;}) - and I get a zero count instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone maybe explain why this isn't working - am I using E() incorrectly? -&amp;nbsp; and suggests any alternatives?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 08:43:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2472873#M99824</guid>
      <dc:creator>Lobby</dc:creator>
      <dc:date>2024-07-25T08:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using a field within E() set modifier and the aggregation count.</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473204#M99854</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/252054"&gt;@Lobby&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all, thank you for your support in advance! Some background about my data (unfortunately cannot share) :&lt;/P&gt;
&lt;P&gt;I have a data model of work cases, the fields include worker_id, case ID, case type, start date, and completion date. If the case hasn't been started or completed, those fields will be null values. If a case has been open for a month and isn't completed it is 'overdue'. I am not the app owner so limited control.&amp;nbsp;&lt;A href="https://www-choiceadvantage.com" target="_blank" rel="noopener"&gt;&lt;FONT size="1 2 3 4 5 6 7" color="#FFFFFF"&gt;Official Site&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;My objective is to create a dashboard that has a table listing all cases that do not have a completion date and a KPI that counts the number of cases and the number of workers. I have used set analysis and the functions P() and E() to successfully create the API. Specifically:&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;&lt;BR /&gt;case_type={'X','Y'}&lt;BR /&gt;,case_id=E({1&amp;lt;completion_date={"*"}&amp;gt;})&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Distinct case_id)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above code works to count the number of cases and I replace the case_id at the end with worker_id to get the count of workers. However, I noticed that when I select a single case, the case-count KPI reflects the total count of cases still where as the worker-count KPI changes to reflect the manual selection I have made. I am trying to get both to reflect manual selections made. I tried removing the 1 in my E() function which made no difference and I have tried using a different field to equate to my E() - i.e&amp;nbsp;case_type=E({1&amp;lt;completion_date={"*"}&amp;gt;}) - and I get a zero count instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can anyone maybe explain why this isn't working - am I using E() incorrectly? -&amp;nbsp; and suggests any alternatives?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;It’s great that you’re using set analysis to create your dashboard. Let’s address the issue you’re facing with the KPIs not reflecting manual selections as expected.&lt;/P&gt;
&lt;P&gt;E() Function:&lt;BR /&gt;The E() function in set analysis is used to exclude specific values from a field.&lt;BR /&gt;In your case, you’re excluding cases with a completion date (i.e., {1&amp;lt;completion_date={"*"}&amp;gt;}).&lt;BR /&gt;However, this exclusion applies to the entire expression, affecting both case count and worker count.&lt;BR /&gt;Alternative Approach:&lt;BR /&gt;To achieve your goal, consider using separate expressions for case count and worker count.&lt;BR /&gt;Instead of using E(), create two separate expressions—one for cases and one for workers.&lt;BR /&gt;Example Expressions:&lt;BR /&gt;Case Count:&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;case_type={'X','Y'}, completion_date={"*"}&amp;gt;} Distinct case_id)&lt;/P&gt;
&lt;P&gt;Worker Count:&lt;BR /&gt;Count({&amp;lt;case_type={'X','Y'}, completion_date={"*"}&amp;gt;} Distinct worker_id)&lt;/P&gt;
&lt;P&gt;Explanation:&lt;BR /&gt;By including completion_date={"*"}, you ensure that both case count and worker count consider only cases without a completion date.&lt;BR /&gt;This way, manual selections will affect each count independently.&lt;BR /&gt;Remember to adapt the expressions to your specific field names and requirements. Hopefully, this approach will give you the desired results!&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;samuel898&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2024 04:25:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473204#M99854</guid>
      <dc:creator>samuel898</dc:creator>
      <dc:date>2024-07-27T04:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using a field within E() set modifier and the aggregation count.</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473514#M99892</link>
      <description>&lt;P&gt;Hi Samuel,&lt;/P&gt;
&lt;P&gt;Thank you for the reply! I fear I was clear in my post, allow me to try and correct that.&lt;/P&gt;
&lt;P&gt;I meant that I have two KPIs, one that counts workers and one that counts cases. Rereading my post, I see how that reads as if I have one that does both, what I get for posting at the end of the work day!&lt;/P&gt;
&lt;P&gt;That being said, I appreciated your suggested set analysis. I replaced the E() part with just "&lt;SPAN&gt;completion_date-={"*"}" (minus sign for not equals to in order to exclude anything with a completion data) but this just now returns zero?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;My confusion stems from the fact that this KPI doesn't respond when a case ID is selected:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;case_type={'X','Y'}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;,case_id=E({1&amp;lt;completion_date={"*"}&amp;gt;})&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Distinct case_id)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But this one does:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Count({&amp;lt;&lt;BR /&gt;case_type={'X','Y'}&lt;BR /&gt;,case_id=E({1&amp;lt;completion_date={"*"}&amp;gt;})&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Distinct worker_id)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My suspicion is because the case_id is used in the E() term where as worker_id is not. As I said, trying to use a different field in the E() term returns zero so I'm a bit stuck. I would appreciate any insight into this!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 10:46:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473514#M99892</guid>
      <dc:creator>Lobby</dc:creator>
      <dc:date>2024-07-29T10:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using a field within E() set modifier and the aggregation count.</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473530#M99893</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/252054"&gt;@Lobby&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I'm not sure if it'll work but have you tried using set operators? Using * as a set operator should give you an intersection of two datasets, so my suggestion would be:&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;&lt;BR /&gt;case_type={'X','Y'}&lt;BR /&gt;,case_id=E({1&amp;lt;completion_date={"*"}&amp;gt;&lt;BR /&gt;*$&amp;lt;case_id&amp;gt;})&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Distinct case_id)&lt;/P&gt;
&lt;P&gt;If i understand the documentation correctly, the first set expression gives you all case_ids without a completion date and the second should give you all case_ids matching the current selection, so i guess the intersection should return your required dataset.&lt;/P&gt;
&lt;P&gt;Let me know, if this worked for you!&lt;/P&gt;
&lt;P&gt;EDIT:&lt;/P&gt;
&lt;P&gt;Apparently you can just use '*=', according to official Qlik documentation this already returns the intersection of all selected values and the set expression.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="lennart_mo_0-1722254648071.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/170017i5F6FD172B6FA35D3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="lennart_mo_0-1722254648071.png" alt="lennart_mo_0-1722254648071.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So your expression should work like this:&lt;/P&gt;
&lt;P&gt;Count({&amp;lt;&lt;BR /&gt;case_type={'X','Y'}&lt;BR /&gt;,case_id*=E({1&amp;lt;completion_date={"*"}&amp;gt;})&lt;BR /&gt;&amp;gt;}&lt;BR /&gt;Distinct case_id)&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2024 12:05:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473530#M99893</guid>
      <dc:creator>lennart_mo</dc:creator>
      <dc:date>2024-07-29T12:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using a field within E() set modifier and the aggregation count.</title>
      <link>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473707#M99925</link>
      <description>&lt;P&gt;Thank you so much! That fixed it immediately, I really appreciate your help!&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2024 08:51:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-a-field-within-E-set-modifier-and-the-aggregation-count/m-p/2473707#M99925</guid>
      <dc:creator>Lobby</dc:creator>
      <dc:date>2024-07-30T08:51:12Z</dc:date>
    </item>
  </channel>
</rss>

