<?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: Perform aggregation at backend qliksense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834434#M68892</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146379"&gt;@stevejoyce&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KPI_Code is coming from Fait Table and it has below values :-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_0-1631033456117.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61530i2AB271FC3CB5CC16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aspiring_Developer_0-1631033456117.png" alt="Aspiring_Developer_0-1631033456117.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_1-1631033472205.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61531i7847D6E0714BF0EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aspiring_Developer_1-1631033472205.png" alt="Aspiring_Developer_1-1631033472205.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I passed the value in set analysis like below :-&lt;/P&gt;&lt;P&gt;Avg({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} aggr_entity_periode_Nbr_percent_of_total)&lt;/P&gt;&lt;P&gt;I did this because i need to calculate this expression for all KPI's . Still my value have reduced .&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 16:53:38 GMT</pubDate>
    <dc:creator>Aspiring_Developer</dc:creator>
    <dc:date>2021-09-07T16:53:38Z</dc:date>
    <item>
      <title>Perform aggregation at backend qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834387#M68884</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;Request you to please help mw with below scenario :-&lt;/P&gt;&lt;P&gt;I have below set of expression in qliksense chart and it is taking too long to load and at the end getting 'calculation time out error" :-&lt;/P&gt;&lt;P&gt;1)if(GetSelectedCount(Periode)=0, Sum({&amp;lt;KPI_Code={'KPI101'},Periode={'$(=$(Maxscorecard) )'}&amp;gt;} Nbr_KO)/Sum({&amp;lt;KPI_Code={'KPI101'},Periode={'$(=$(Maxscorecard) )'}&amp;gt;} Nbr_TOTAL),&lt;BR /&gt;avg(aggr(Sum({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} Nbr_KO)/Sum({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} Nbr_TOTAL),Periode,Entity)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After breaking the expression , i got to know that the second expression of else part is the root cause :-&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;avg(aggr(Sum({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} Nbr_KO)/Sum({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} Nbr_TOTAL),Periode,Entity)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This formula is taking too long the load the data inside chart.&lt;/P&gt;&lt;P&gt;Below is the data model and the fields coming from each table :-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_0-1631025729411.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61512iDF69F1EDCC750D86/image-size/large?v=v2&amp;amp;px=999" role="button" title="Aspiring_Developer_0-1631025729411.png" alt="Aspiring_Developer_0-1631025729411.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I want to do this calculation in backend , but not sure how to do it.&lt;/P&gt;&lt;P&gt;I tired to below :-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_1-1631025811638.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61514i2655255255EAEEB3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aspiring_Developer_1-1631025811638.png" alt="Aspiring_Developer_1-1631025811638.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and then did this in front end expression :-&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;avg(Aggr({&amp;lt;KPI_Code={'KPI101'}&amp;gt;}Test, Entity))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;But it didn't worked.&lt;/P&gt;&lt;P&gt;Am i not following the correct approach? Please help .&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 14:46:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834387#M68884</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-09-07T14:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Perform aggregation at backend qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834402#M68886</link>
      <description>&lt;P&gt;Your fields you are aggr'ing on, should be you joining key (composite key) in your data model and what you are grouping by.&amp;nbsp; I also am assuming there are many _KEY_DIM to 1 Entity, so you should map KEY_DIM to Entity first.&amp;nbsp; I added another step in the middle that converts the composite of Periode+Entity to a numeric value.&lt;/P&gt;&lt;P&gt;So you should have a new table joined to Fait on&amp;nbsp;Key_Entity_Periode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;map_entity_key_dim:&lt;BR /&gt;mapping load distinct&lt;BR /&gt;_KEY_DIM&lt;BR /&gt;,Entity&lt;BR /&gt;resident ORGA&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;temp1_PossibleCombinations:&lt;BR /&gt;Load distinct&lt;BR /&gt;_KEY_DIM&lt;BR /&gt;,Periode&lt;BR /&gt;,Periode &amp;amp; '|' &amp;amp; applymap('map_entity_key_dim', _KEY_DIM) as text_Key_Entity_Periode&lt;BR /&gt;resident Fait;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;temp2_DistinctValues:&lt;BR /&gt;mapping load distinct&lt;BR /&gt;text_Key_Entity_Periode&lt;BR /&gt;,RowNo() as Key_Entity_Periode&lt;BR /&gt;resident temp1_PossibleCombinations;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;drop table temp1_PossibleCombinations;&lt;/P&gt;&lt;P&gt;//join numeric key to Fait table&lt;BR /&gt;left join (Fait)&lt;BR /&gt;load distinct&lt;BR /&gt;_KEY_DIM&lt;BR /&gt;,Periode&lt;BR /&gt;,applymap('temp2_DistinctValues', Periode &amp;amp; '|' &amp;amp; applymap('map_entity_key_dim', _KEY_DIM)) as Key_Entity_Periode&lt;BR /&gt;resident Fait;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;aggr_entity_periode:&lt;BR /&gt;Load distinct&lt;BR /&gt;Key_Entity_Periode&lt;BR /&gt;,Sum(Nbr_KO) / Sum(Nbr_TOTAL) as aggr_entity_periode_Nbr_percent_of_total&lt;BR /&gt;Resident Fait&lt;BR /&gt;group by Key_Entity_Periode&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;exit script;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 15:25:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834402#M68886</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-09-07T15:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: Perform aggregation at backend qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834421#M68888</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146379"&gt;@stevejoyce&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for sharing the solution . I tried your approach , however i am not able to get the correct values.&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance:-&lt;/P&gt;&lt;P&gt;Original Formulae -&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(GetSelectedCount(Periode)=0, Sum({&amp;lt;KPI_Code={'KPI101'},Periode={'$(=$(Maxscorecard) )'}&amp;gt;} Nbr_KO)/Sum({&amp;lt;KPI_Code={'KPI101'},Periode={'$(=$(Maxscorecard) )'}&amp;gt;} Nbr_TOTAL),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;avg(aggr(Sum({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} Nbr_KO)/Sum({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} Nbr_TOTAL),Periode,Entity)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_0-1631032130014.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61526iA9A8C92A0D93697C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Aspiring_Developer_0-1631032130014.png" alt="Aspiring_Developer_0-1631032130014.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After doing the else part aggregation at backend , and then applying the new field in front end , i should get the same result as i was getting using old formula , however my number is significantly decreased like below :-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_1-1631032338935.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61527iA4297F7C0126F7D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Aspiring_Developer_1-1631032338935.png" alt="Aspiring_Developer_1-1631032338935.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Using this expression -&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(GetSelectedCount(Periode)=0, Sum({&amp;lt;KPI_Code={'KPI101'},Periode={'$(=$(Maxscorecard) )'}&amp;gt;} Nbr_KO)/Sum({&amp;lt;KPI_Code={'KPI101'},Periode={'$(=$(Maxscorecard) )'}&amp;gt;} Nbr_TOTAL),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;avg(aggr_entity_periode_Nbr_percent_of_total))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please help ?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 16:33:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834421#M68888</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-09-07T16:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: Perform aggregation at backend qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834429#M68890</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146379"&gt;@stevejoyce&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just to add , according to the old expression :-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if(GetSelectedCount(Periode)=0, Sum({&amp;lt;KPI_Code={'KPI101'},Periode={'$(=$(Maxscorecard) )'}&amp;gt;} Nbr_KO)/Sum({&amp;lt;KPI_Code={'KPI101'},Periode={'$(=$(Maxscorecard) )'}&amp;gt;} Nbr_TOTAL),&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;avg(aggr(Sum({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} Nbr_KO)/Sum({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} Nbr_TOTAL),Periode,Entity)))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If i am not doing any selection on filter 'Periode', then my value should be :-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_0-1631033025557.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61528i8B1CB6B622D8B8A1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Aspiring_Developer_0-1631033025557.png" alt="Aspiring_Developer_0-1631033025557.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And when we do any selection 'Periode' = Aug 2021, then it should give below :-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_1-1631033099193.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61529i76FD8A0320B4A231/image-size/large?v=v2&amp;amp;px=999" role="button" title="Aspiring_Developer_1-1631033099193.png" alt="Aspiring_Developer_1-1631033099193.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also , right now my entire value is decreased .&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 16:45:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834429#M68890</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-09-07T16:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Perform aggregation at backend qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834430#M68891</link>
      <description>&lt;P&gt;I did not filter to&amp;nbsp;&lt;STRONG&gt;KPI_Code={'KPI101'}&lt;/STRONG&gt;, did you add this to the load script I sent?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;aggr_entity_periode:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Load distinct&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Key_Entity_Periode&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;,Sum(Nbr_KO) / Sum(Nbr_TOTAL) as aggr_entity_periode_Nbr_percent_of_total&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resident Fait&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;where&amp;nbsp;KPI_Code='KPI101'&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;group by Key_Entity_Periode&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 16:49:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834430#M68891</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-09-07T16:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Perform aggregation at backend qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834434#M68892</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/146379"&gt;@stevejoyce&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KPI_Code is coming from Fait Table and it has below values :-&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_0-1631033456117.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61530i2AB271FC3CB5CC16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aspiring_Developer_0-1631033456117.png" alt="Aspiring_Developer_0-1631033456117.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Aspiring_Developer_1-1631033472205.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/61531i7847D6E0714BF0EE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Aspiring_Developer_1-1631033472205.png" alt="Aspiring_Developer_1-1631033472205.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I passed the value in set analysis like below :-&lt;/P&gt;&lt;P&gt;Avg({&amp;lt;KPI_Code={'KPI101'}&amp;gt;} aggr_entity_periode_Nbr_percent_of_total)&lt;/P&gt;&lt;P&gt;I did this because i need to calculate this expression for all KPI's . Still my value have reduced .&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 16:53:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834434#M68892</guid>
      <dc:creator>Aspiring_Developer</dc:creator>
      <dc:date>2021-09-07T16:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Perform aggregation at backend qliksense</title>
      <link>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834436#M68893</link>
      <description>&lt;P&gt;Those are logically different though.&amp;nbsp; In your load script we are calculating the sum for each period/entities, and then you are only averaging where there are period/entities that have a KPI101.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your front-end calculation you are only summing only for KPI101.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to distinguish for each KPI, then you should add KPI_Code to your composite key (in both your groupby &amp;amp; join field).&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 17:03:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Perform-aggregation-at-backend-qliksense/m-p/1834436#M68893</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-09-07T17:03:05Z</dc:date>
    </item>
  </channel>
</rss>

