<?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: Double aggregation + set expression with exceptions for ignoring selection in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675316#M51288</link>
    <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg({1} Aggr(
   Count({1&amp;lt;escalation_type = {'first_line'}&amp;gt;} room_id)/Count(DISTINCT {1&amp;lt;escalation_type = p(escalation_type)&amp;gt;} room_id)
, day))&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 13 Feb 2020 13:14:57 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2020-02-13T13:14:57Z</dc:date>
    <item>
      <title>Double aggregation + set expression with exceptions for ignoring selection</title>
      <link>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675291#M51283</link>
      <description>&lt;DIV class="p-rich_text_section"&gt;Hi! Asking for help from anyone strong in set analysis.&lt;BR /&gt;&lt;BR /&gt;I have a KPI object with two fields for a single metric. The first, main field shows an average of counts of an event per day and reacts to all selections. The second shows an average of counts per day over all time, ignoring all selections. They both work fine.&lt;BR /&gt;&lt;BR /&gt;Problem 1: I am wondering how I could make the second field (all time average) respond to one selection and ignore all others –&amp;nbsp;so that it would show me the average over all time but according to the selection in variable escalation_type (with values like "first_line", "second_line"). Does anyone know how to add this exception to my set expression?&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;Problem 2: Similar issue but a different metric: the second, all time average field needs to function in the same way as described above, but contains a more complex expression because of the calculation performed inside.&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="p-rich_text_section"&gt;My current expressions look like this:&lt;/DIV&gt;&lt;PRE&gt;Problem 1. avg({1}aggr(count({1}escalated_at), day))&lt;BR /&gt;---&lt;BR /&gt;Problem 2: avg({1}aggr(count({1}if(escalation_type = 'first_line',room_id))/count(distinct {1}room_id), day))&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Is there anyone who can guide me to the right direction? I have seen how to make exceptions to selection in general, but these examples never contain any double aggregations or calculations, so I don't know how to place the necessary exception conditions into my aggregations. Will appreciate any help!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 19:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675291#M51283</guid>
      <dc:creator>ktlnrrrr</dc:creator>
      <dc:date>2024-11-16T19:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: Double aggregation + set expression with exceptions for ignoring selection</title>
      <link>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675294#M51284</link>
      <description>&lt;P&gt;For the first problem you can try one of these expressions&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg({1} Aggr(Count({1&amp;lt;escalation_type = P(escalation_type)&amp;gt;} escalated_at), day))&lt;/LI-CODE&gt;&lt;P&gt;or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg({1} Aggr(Count({1&amp;lt;escalation_type = $::escalation_type&amp;gt;} escalated_at), day))&lt;/LI-CODE&gt;&lt;P&gt;For the second problem, I am not sure what exactly are you looking to get modified?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 12:32:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675294#M51284</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-02-13T12:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: Double aggregation + set expression with exceptions for ignoring selection</title>
      <link>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675311#M51287</link>
      <description>&lt;P&gt;Thanks a million, it worked perfectly for the first problem!&lt;BR /&gt;&lt;BR /&gt;For the second one, I am looking to use it in the same way for the outcome of the division. So the following means: if escalation type = first line, then divide count of room_id by count of distinct room_id. The outcome is basically the reiteration rate.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;({1}if(escalation_type = 'first_line',room_id))/count(distinct {1}room_id)&lt;/LI-CODE&gt;&lt;P&gt;Then, the averaging is put around it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;avg({1}aggr(count({1}if(escalation_type = 'first_line',room_id))/count(distinct {1}room_id), day))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Would you possibly know where should I insert this condition of ignore all selections except escalation_type when I am dealing with a division inside the expression?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 13:10:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675311#M51287</guid>
      <dc:creator>ktlnrrrr</dc:creator>
      <dc:date>2020-02-13T13:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Double aggregation + set expression with exceptions for ignoring selection</title>
      <link>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675316#M51288</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Avg({1} Aggr(
   Count({1&amp;lt;escalation_type = {'first_line'}&amp;gt;} room_id)/Count(DISTINCT {1&amp;lt;escalation_type = p(escalation_type)&amp;gt;} room_id)
, day))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Feb 2020 13:14:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675316#M51288</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-02-13T13:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Double aggregation + set expression with exceptions for ignoring selection</title>
      <link>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675319#M51289</link>
      <description>&lt;P&gt;Thanks so much, worked like a charm!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Feb 2020 13:22:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Double-aggregation-set-expression-with-exceptions-for-ignoring/m-p/1675319#M51289</guid>
      <dc:creator>ktlnrrrr</dc:creator>
      <dc:date>2020-02-13T13:22:12Z</dc:date>
    </item>
  </channel>
</rss>

