<?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 Pivot Table TOTAL with Calculated Dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Pivot-Table-TOTAL-with-Calculated-Dimension/m-p/1556234#M40307</link>
    <description>&lt;P&gt;Hello, I am currently working on a complicated Pivot Table. Simply stated, I am trying to group students up into different testing percentile groups (1st - 20th percentile, 21st - 30th percentile, etc.). I've done this easily enough by creating a calculated dimension that uses the class() function to calculate the percentiles and then group them up.&lt;/P&gt;&lt;P&gt;The issue is that I have a second dimension (Student) where I am trying to show the Average Score of the percentile group. Normally, this would be easy and I would just use the TOTAL qualifier. But since I am using a calculated dimension, I can't get the expression to calculate over the percentile groups.&lt;/P&gt;&lt;P&gt;Here is what I have with no rows expanded:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 884px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/7956iC90C178E94539653/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And when I expand a row I expect to see this (I have hard coded the expression to 89.7 as an example):&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 893px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/7957i21EC2813910128F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dimensions:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Percentile Group:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;=replace(replace(replace(
    class(aggr({$} 
        (((
            count({$} DISTINCT TOTAL [Student]) - 
            rank(TOTAL avg({$} [Score]), 3)
        ) / 
        count({$} DISTINCT TOTAL [Student])
        ) * 100), [Student]
    ), 20), '0 &amp;lt;= x &amp;lt; ', '1st - '), '0', '0th Percentiles'), '10th Percentiles0th Percentiles', '99th Percentiles'
)&lt;/PRE&gt;&lt;P&gt;Student: [Student]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Measures&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;Average Score: =avg({$} [Score])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally for the measure I would just use avg({$} TOTAL&amp;lt;[dimension 1]&amp;gt; [Score]). But since that dimension is a calculated dimension, I am unable to.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 06:20:45 GMT</pubDate>
    <dc:creator>dselgo_eidex</dc:creator>
    <dc:date>2024-11-16T06:20:45Z</dc:date>
    <item>
      <title>Pivot Table TOTAL with Calculated Dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-Table-TOTAL-with-Calculated-Dimension/m-p/1556234#M40307</link>
      <description>&lt;P&gt;Hello, I am currently working on a complicated Pivot Table. Simply stated, I am trying to group students up into different testing percentile groups (1st - 20th percentile, 21st - 30th percentile, etc.). I've done this easily enough by creating a calculated dimension that uses the class() function to calculate the percentiles and then group them up.&lt;/P&gt;&lt;P&gt;The issue is that I have a second dimension (Student) where I am trying to show the Average Score of the percentile group. Normally, this would be easy and I would just use the TOTAL qualifier. But since I am using a calculated dimension, I can't get the expression to calculate over the percentile groups.&lt;/P&gt;&lt;P&gt;Here is what I have with no rows expanded:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 884px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/7956iC90C178E94539653/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And when I expand a row I expect to see this (I have hard coded the expression to 89.7 as an example):&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 893px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/7957i21EC2813910128F2/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dimensions:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Percentile Group:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;=replace(replace(replace(
    class(aggr({$} 
        (((
            count({$} DISTINCT TOTAL [Student]) - 
            rank(TOTAL avg({$} [Score]), 3)
        ) / 
        count({$} DISTINCT TOTAL [Student])
        ) * 100), [Student]
    ), 20), '0 &amp;lt;= x &amp;lt; ', '1st - '), '0', '0th Percentiles'), '10th Percentiles0th Percentiles', '99th Percentiles'
)&lt;/PRE&gt;&lt;P&gt;Student: [Student]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Measures&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;Average Score: =avg({$} [Score])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally for the measure I would just use avg({$} TOTAL&amp;lt;[dimension 1]&amp;gt; [Score]). But since that dimension is a calculated dimension, I am unable to.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:20:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-Table-TOTAL-with-Calculated-Dimension/m-p/1556234#M40307</guid>
      <dc:creator>dselgo_eidex</dc:creator>
      <dc:date>2024-11-16T06:20:45Z</dc:date>
    </item>
  </channel>
</rss>

