<?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: Incorrect Percentage Total in straight table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469445#M99545</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;thanks for the reply. I've tried your suggestion but it does not fix the issue. I think the issue is that my % Spend master measure is derived from two other master measure items:&lt;/P&gt;
&lt;P&gt;My % Spend master item is derived from two other master items:&lt;/P&gt;
&lt;P&gt;Days Logged =&amp;nbsp;Sum(clockify_hours_logged/vWorkingHours)&lt;/P&gt;
&lt;P&gt;Demand (Days) =&amp;nbsp;If(GetSelectedCount(period)=0, max(sd_demand)&lt;BR /&gt;,If(GetSelectedCount(period)&amp;gt;0, (max(sd_demand)/12)*GetSelectedCount(period)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I then create my % Spend master item&lt;/P&gt;
&lt;P&gt;% Spend = Days Logged / Demand (Days)&lt;/P&gt;
&lt;P&gt;Qlik will not allow me to create a master items which sums these:&lt;/P&gt;
&lt;P&gt;sum(Days Logged) / Sum (Demand (Days)&lt;/P&gt;
&lt;P&gt;I don't think you can create master item which sums up other master measures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Paul&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jul 2024 08:20:27 GMT</pubDate>
    <dc:creator>JohnnyUtah</dc:creator>
    <dc:date>2024-07-10T08:20:27Z</dc:date>
    <item>
      <title>Incorrect Percentage Total in straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469298#M99533</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a straight table consisting of 6 dimensions and six measures.&lt;/P&gt;
&lt;P&gt;% Spend is simply Days Logged / Demand (Days), so I'm expecting the % Spend below to be 41.7%&lt;/P&gt;
&lt;P&gt;% Spend is a master object formatted as %.&lt;/P&gt;
&lt;P&gt;In the % spend column Total Function is set to Auto.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm fairly new to Qlik so expect there is an easy answer to this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnnyUtah_0-1720551438674.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169131iC46ADABDFF64788A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohnnyUtah_0-1720551438674.png" alt="JohnnyUtah_0-1720551438674.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 19:37:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469298#M99533</guid>
      <dc:creator>JohnnyUtah</dc:creator>
      <dc:date>2024-07-09T19:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Percentage Total in straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469327#M99538</link>
      <description>&lt;P&gt;The issue you're facing with the % Spend calculation in the total line of your Qlik Sense table is likely due to how the Auto total function works for percentages. Instead of calculating the total percentage as the sum of individual percentages, you want it to calculate the percentage based on the total values.&lt;/P&gt;
&lt;P&gt;Here's how you can resolve this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Create a new measure for the total % Spend:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Go to the "Master Items" and create a new measure for &lt;CODE&gt;% Spend&lt;/CODE&gt; if you haven't already.&lt;/LI&gt;
&lt;LI&gt;Use the expression &lt;CODE&gt;Sum([Days Logged]) / Sum([Demand (Days)])&lt;/CODE&gt;.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Use the newly created measure in your table:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Replace the current &lt;CODE&gt;% Spend&lt;/CODE&gt; measure in your table with the new measure you created.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This way, the total % Spend will be calculated based on the total values of &lt;CODE&gt;Days Logged&lt;/CODE&gt; and &lt;CODE&gt;Demand (Days)&lt;/CODE&gt;, ensuring the total line shows the correct percentage.&lt;/P&gt;
&lt;H3&gt;Steps to Create a New Measure:&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;Go to the "Master Items" panel on the left.&lt;/LI&gt;
&lt;LI&gt;Click on "Measures" and then on the "+" icon to create a new measure.&lt;/LI&gt;
&lt;LI&gt;Name the measure, for example, &lt;CODE&gt;Total % Spend&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;Enter the expression:
&lt;DIV class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium"&gt;
&lt;DIV class="overflow-y-auto p-4" dir="ltr"&gt;&lt;CODE class="!whitespace-pre hljs language-plaintext"&gt;Sum([Days Logged]) / Sum([Demand (Days)])
&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI&gt;Set the number formatting to "Number" and format as a percentage.&lt;/LI&gt;
&lt;/OL&gt;
&lt;H3&gt;Replace the Measure in the Table:&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;Edit your table.&lt;/LI&gt;
&lt;LI&gt;Remove the current &lt;CODE&gt;% Spend&lt;/CODE&gt; measure.&lt;/LI&gt;
&lt;LI&gt;Add the newly created measure &lt;CODE&gt;Total % Spend&lt;/CODE&gt;.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This should correct the total percentage calculation in your table.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 23:42:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469327#M99538</guid>
      <dc:creator>Scotchy</dc:creator>
      <dc:date>2024-07-09T23:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Percentage Total in straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469445#M99545</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;thanks for the reply. I've tried your suggestion but it does not fix the issue. I think the issue is that my % Spend master measure is derived from two other master measure items:&lt;/P&gt;
&lt;P&gt;My % Spend master item is derived from two other master items:&lt;/P&gt;
&lt;P&gt;Days Logged =&amp;nbsp;Sum(clockify_hours_logged/vWorkingHours)&lt;/P&gt;
&lt;P&gt;Demand (Days) =&amp;nbsp;If(GetSelectedCount(period)=0, max(sd_demand)&lt;BR /&gt;,If(GetSelectedCount(period)&amp;gt;0, (max(sd_demand)/12)*GetSelectedCount(period)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I then create my % Spend master item&lt;/P&gt;
&lt;P&gt;% Spend = Days Logged / Demand (Days)&lt;/P&gt;
&lt;P&gt;Qlik will not allow me to create a master items which sums these:&lt;/P&gt;
&lt;P&gt;sum(Days Logged) / Sum (Demand (Days)&lt;/P&gt;
&lt;P&gt;I don't think you can create master item which sums up other master measures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;Paul&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 08:20:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469445#M99545</guid>
      <dc:creator>JohnnyUtah</dc:creator>
      <dc:date>2024-07-10T08:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect Percentage Total in straight table</title>
      <link>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469739#M99563</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Maybe try this approach...&lt;/P&gt;
&lt;P&gt;You're correct that Qlik Sense does not allow you to create a master measure that aggregates other master measures directly. However, you can create the necessary aggregation in your table's measure directly.&lt;/P&gt;
&lt;P&gt;To achieve the correct total calculation for &lt;CODE&gt;% Spend&lt;/CODE&gt;, you can use a measure that performs the necessary calculations directly within the table. Here’s how you can proceed:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Edit your table:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Go to the properties panel of your straight table.&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Add a new measure:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Click on "Add measure."&lt;/LI&gt;
&lt;LI&gt;In the expression editor, use the following expression:
&lt;DIV class="dark bg-gray-950 rounded-md border-[0.5px] border-token-border-medium"&gt;
&lt;DIV class="flex items-center relative text-token-text-secondary bg-token-main-surface-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md"&gt;
&lt;DIV class="flex items-center"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="overflow-y-auto p-4" dir="ltr"&gt;&lt;LI-CODE lang="javascript"&gt;Sum(Aggr(Sum(clockify_hours_logged/vWorkingHours), [Your Dimensions])) /
Sum(Aggr(
  If(GetSelectedCount(period)=0, max(sd_demand),
  If(GetSelectedCount(period)&amp;gt;0, (max(sd_demand)/12)*GetSelectedCount(period))),
  [Your Dimensions]
))&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;DIV class="overflow-y-auto p-4" dir="ltr"&gt;&lt;CODE class="!whitespace-pre hljs language-plaintext"&gt;&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;LI&gt;Replace &lt;CODE&gt;[Your Dimensions]&lt;/CODE&gt; with the dimensions used in your table.&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;&lt;STRONG&gt;Format the measure as a percentage:&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Set the number formatting to "Number" and choose "Percentage."&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This approach uses the &lt;CODE&gt;Aggr&lt;/CODE&gt; function to calculate the &lt;CODE&gt;Days Logged&lt;/CODE&gt; and &lt;CODE&gt;Demand (Days)&lt;/CODE&gt; for each dimension combination and then aggregates these values to get the correct total percentage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 23:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Incorrect-Percentage-Total-in-straight-table/m-p/2469739#M99563</guid>
      <dc:creator>Scotchy</dc:creator>
      <dc:date>2024-07-10T23:14:20Z</dc:date>
    </item>
  </channel>
</rss>

