<?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: Change the total type in expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472425#M99797</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/216"&gt;@ali_hijazi&lt;/a&gt;&amp;nbsp; let's say you have variable &lt;STRONG&gt;vType&lt;/STRONG&gt; to switch % and sum, you could try below&lt;/P&gt;
&lt;P&gt;if(Dimensionality()=0 and vType='Percentage',&lt;/P&gt;
&lt;P&gt;avg(aggr(YourExpression,TableDimension1,TableDimension2)),&lt;/P&gt;
&lt;P&gt;if(Dimensionality()=0 and vType='Sum',&lt;/P&gt;
&lt;P&gt;YourSumExpression,&lt;/P&gt;
&lt;P&gt;YourExpression&lt;/P&gt;
&lt;P&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jul 2024 15:16:21 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2024-07-23T15:16:21Z</dc:date>
    <item>
      <title>Change the total type in expression</title>
      <link>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472290#M99777</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;I got a table with 2 dimensions and several expressions&lt;BR /&gt;the expressions got aggregations and they are working well and giving correct results&lt;BR /&gt;there are two options given to the users to show on the chart either the count or the percentage&lt;/P&gt;
&lt;DIV id="tinyMceEditorali_hijazi_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tinyMceEditorali_hijazi_1" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WhatsApp Image 2024-07-23 at 9.55.49 AM.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169782i47A9022797169413/image-size/medium?v=v2&amp;amp;px=400" role="button" title="WhatsApp Image 2024-07-23 at 9.55.49 AM.jpeg" alt="WhatsApp Image 2024-07-23 at 9.55.49 AM.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;now what is required is that when the user clicks the percentage button, the total should display the average of the results and not the sum but when the count button is selected the total should display the sum&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dbe47fb2-2870-4117-8c75-d5ecee8e693e.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169783i8E44742E299E4EBC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dbe47fb2-2870-4117-8c75-d5ecee8e693e.jpeg" alt="dbe47fb2-2870-4117-8c75-d5ecee8e693e.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tried to use the dimensionality() and check what the user selected as percentage or count, and added and Avg(my_expression)&lt;BR /&gt;I got an error for nested aggregation not allowed&lt;BR /&gt;is there a way to tackle this issue?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 07:16:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472290#M99777</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2024-07-23T07:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change the total type in expression</title>
      <link>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472389#M99789</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/216"&gt;@ali_hijazi&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Qlik doesn't allow using an aggregation-function inside another aggregation normally, which is called nested aggregation.&lt;/P&gt;
&lt;P&gt;You can bypass this by either using the TOTAL qualifier inside the inner aggregation or by using the AGGR()-Function.&lt;/P&gt;
&lt;P&gt;Could you post your initial formula which gave you this error?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 12:53:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472389#M99789</guid>
      <dc:creator>lennart_mo</dc:creator>
      <dc:date>2024-07-23T12:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Change the total type in expression</title>
      <link>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472425#M99797</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/216"&gt;@ali_hijazi&lt;/a&gt;&amp;nbsp; let's say you have variable &lt;STRONG&gt;vType&lt;/STRONG&gt; to switch % and sum, you could try below&lt;/P&gt;
&lt;P&gt;if(Dimensionality()=0 and vType='Percentage',&lt;/P&gt;
&lt;P&gt;avg(aggr(YourExpression,TableDimension1,TableDimension2)),&lt;/P&gt;
&lt;P&gt;if(Dimensionality()=0 and vType='Sum',&lt;/P&gt;
&lt;P&gt;YourSumExpression,&lt;/P&gt;
&lt;P&gt;YourExpression&lt;/P&gt;
&lt;P&gt;)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jul 2024 15:16:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472425#M99797</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2024-07-23T15:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Change the total type in expression</title>
      <link>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472584#M99803</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I tried this approach but I got an error saying nested aggregation is not allowed&lt;BR /&gt;that's because YourExpression is a variable with aggregation too&lt;BR /&gt;&lt;BR /&gt;what I did is I created two measures one with total function Count and another with total function avg&lt;BR /&gt;and each measure is hidden or visible depending on whether the user selected Count or Percentage&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jul 2024 07:35:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Change-the-total-type-in-expression/m-p/2472584#M99803</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2024-07-24T07:35:17Z</dc:date>
    </item>
  </channel>
</rss>

