<?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 Divide calculated values in pivot table by total row in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1821741#M1213595</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I read a lot of responses to former questions in the forum, but none of the suggested solutions worked for me.&lt;/P&gt;&lt;P&gt;I have following table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Diana_B_0-1626178778886.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/58480iAB7F1EC7341AE143/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Diana_B_0-1626178778886.png" alt="Diana_B_0-1626178778886.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;"Anzahl Patient pro Therapieklasse" is a calculated field:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count(Distinct [Patienten-ID])&lt;/LI-CODE&gt;&lt;P&gt;Now in the field "Anteil Patienten mit Therapieklasse" I want to divide "Anzahl Patient pro Therapieklasse" by the total value (543). Example: for "Therapieklasse A": 505/543 = &lt;STRONG&gt;93,00&lt;/STRONG&gt;.&lt;BR /&gt;The total value of 543 shows the number of all patients.&lt;BR /&gt;One patient can have more than one "Therapieklasse". Therefore the total vaule 543 is not equal to the sum of all rows.&lt;/P&gt;&lt;P&gt;As suggested in other forum entries I already tried to use this experssion:&lt;BR /&gt;&lt;STRONG&gt;(sum(count(Distinct [Patienten-ID]))) / (sum(TOTAL &amp;lt;Therapieklasse&amp;gt; (count(Distinct [Patienten-ID]))))&lt;/STRONG&gt;&lt;BR /&gt;but it doesn't work.&lt;/P&gt;&lt;P&gt;Can you please tell me what I made wrong or which expression I should use?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Diana&lt;/P&gt;</description>
    <pubDate>Tue, 13 Jul 2021 12:33:32 GMT</pubDate>
    <dc:creator>Diana_B</dc:creator>
    <dc:date>2021-07-13T12:33:32Z</dc:date>
    <item>
      <title>Divide calculated values in pivot table by total row</title>
      <link>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1821741#M1213595</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I read a lot of responses to former questions in the forum, but none of the suggested solutions worked for me.&lt;/P&gt;&lt;P&gt;I have following table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Diana_B_0-1626178778886.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/58480iAB7F1EC7341AE143/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Diana_B_0-1626178778886.png" alt="Diana_B_0-1626178778886.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;"Anzahl Patient pro Therapieklasse" is a calculated field:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count(Distinct [Patienten-ID])&lt;/LI-CODE&gt;&lt;P&gt;Now in the field "Anteil Patienten mit Therapieklasse" I want to divide "Anzahl Patient pro Therapieklasse" by the total value (543). Example: for "Therapieklasse A": 505/543 = &lt;STRONG&gt;93,00&lt;/STRONG&gt;.&lt;BR /&gt;The total value of 543 shows the number of all patients.&lt;BR /&gt;One patient can have more than one "Therapieklasse". Therefore the total vaule 543 is not equal to the sum of all rows.&lt;/P&gt;&lt;P&gt;As suggested in other forum entries I already tried to use this experssion:&lt;BR /&gt;&lt;STRONG&gt;(sum(count(Distinct [Patienten-ID]))) / (sum(TOTAL &amp;lt;Therapieklasse&amp;gt; (count(Distinct [Patienten-ID]))))&lt;/STRONG&gt;&lt;BR /&gt;but it doesn't work.&lt;/P&gt;&lt;P&gt;Can you please tell me what I made wrong or which expression I should use?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Diana&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jul 2021 12:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1821741#M1213595</guid>
      <dc:creator>Diana_B</dc:creator>
      <dc:date>2021-07-13T12:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Divide calculated values in pivot table by total row</title>
      <link>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1821939#M1213613</link>
      <description>&lt;P&gt;Hi Diana,&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;Assign the variable with the formula like below&lt;/P&gt;&lt;P&gt;vNoOfPatients&amp;nbsp; &lt;STRONG&gt;=&lt;/STRONG&gt; count(Distinct [Patienten-ID])&lt;/P&gt;&lt;P&gt;If we use equal assign, it calculates the formula and will store 543 in the&amp;nbsp;vNoOfPatients&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the chat, try like below&lt;/P&gt;&lt;P&gt;= count(Distinct [Patienten-ID]) / vNoOfPatients&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Else, pls attach the sample file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 01:53:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1821939#M1213613</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-07-14T01:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Divide calculated values in pivot table by total row</title>
      <link>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1821940#M1213614</link>
      <description>&lt;P&gt;Try like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count(Distinct [Patienten-ID]) /count(Distinct&amp;nbsp; &lt;STRONG&gt;TOTAL &lt;/STRONG&gt;[Patienten-ID])&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jul 2021 02:11:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1821940#M1213614</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2021-07-14T02:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: Divide calculated values in pivot table by total row</title>
      <link>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1822254#M1213644</link>
      <description>&lt;P&gt;Yes, it helped &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The values are exactly wthat I wanted them to be.&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 05:57:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Divide-calculated-values-in-pivot-table-by-total-row/m-p/1822254#M1213644</guid>
      <dc:creator>Diana_B</dc:creator>
      <dc:date>2021-07-15T05:57:57Z</dc:date>
    </item>
  </channel>
</rss>

