<?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 Rank as column in pivot table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Rank-as-column-in-pivot-table/m-p/2520081#M106367</link>
    <description>&lt;P&gt;Hi I'm trying to display the rank calculated with a chart function as the columns in a pivot table but can't get this to work.&amp;nbsp; My data looks like this.&amp;nbsp; Each visit has an incrementing ID value so I can rank them per person to get a relative visit number.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waynea_0-1749033848027.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/181028iAFC1D59D83B55074/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waynea_0-1749033848027.png" alt="waynea_0-1749033848027.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And I'd like the pivot table to look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waynea_2-1749034077777.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/181030i21F739DEC8988FC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waynea_2-1749034077777.png" alt="waynea_2-1749034077777.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I do the rank as a select from the database as it's own column in the load, this works.&amp;nbsp; But I need to be able to allow the user to select different date ranges so I need the rank to be calculated as the filtering is applied so the visit numbers always start at 1.&lt;/P&gt;&lt;P&gt;I've tried using Rank(VisitID) and although it says "ok" in the expression editor, results in an invalid dimension.&lt;/P&gt;&lt;P&gt;I saw an example using an aggregate and tried Aggr(Rank(VisitID),User) but that shows only 1 visit per person like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waynea_3-1749035683090.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/181032i93F2B3560EA82BF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waynea_3-1749035683090.png" alt="waynea_3-1749035683090.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any ideas and help.&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, 04 Jun 2025 11:18:17 GMT</pubDate>
    <dc:creator>wayne-a</dc:creator>
    <dc:date>2025-06-04T11:18:17Z</dc:date>
    <item>
      <title>Rank as column in pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-as-column-in-pivot-table/m-p/2520081#M106367</link>
      <description>&lt;P&gt;Hi I'm trying to display the rank calculated with a chart function as the columns in a pivot table but can't get this to work.&amp;nbsp; My data looks like this.&amp;nbsp; Each visit has an incrementing ID value so I can rank them per person to get a relative visit number.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waynea_0-1749033848027.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/181028iAFC1D59D83B55074/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waynea_0-1749033848027.png" alt="waynea_0-1749033848027.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And I'd like the pivot table to look like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waynea_2-1749034077777.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/181030i21F739DEC8988FC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waynea_2-1749034077777.png" alt="waynea_2-1749034077777.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I do the rank as a select from the database as it's own column in the load, this works.&amp;nbsp; But I need to be able to allow the user to select different date ranges so I need the rank to be calculated as the filtering is applied so the visit numbers always start at 1.&lt;/P&gt;&lt;P&gt;I've tried using Rank(VisitID) and although it says "ok" in the expression editor, results in an invalid dimension.&lt;/P&gt;&lt;P&gt;I saw an example using an aggregate and tried Aggr(Rank(VisitID),User) but that shows only 1 visit per person like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="waynea_3-1749035683090.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/181032i93F2B3560EA82BF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="waynea_3-1749035683090.png" alt="waynea_3-1749035683090.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any ideas and help.&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, 04 Jun 2025 11:18:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-as-column-in-pivot-table/m-p/2520081#M106367</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2025-06-04T11:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Rank as column in pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-as-column-in-pivot-table/m-p/2520293#M106398</link>
      <description>&lt;P&gt;Hi Wayne,&lt;/P&gt;&lt;P&gt;You are pretty close, I think. If you want to rank visits by User, your aggregation should include VisitID as one of the dimensions, like this:&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Aggr(Rank(VisitID),User, VisitID)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;To be sure that visits are sorted correctly, you may want to sort your visits within the AGGR:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Aggr(Rank(VisitID), User,&amp;nbsp;(VisitID (NUMERIC, ASC)) )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Allow me to invite you to my sessions on Set Analysis and AGGR at the Masters Summit for Qlik (coming up to Hamburg soon) or to my Qlik Expert Class (coming up to Vienna soon). See links in my signature.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Oleg Troyansky&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 19:00:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-as-column-in-pivot-table/m-p/2520293#M106398</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2025-06-05T19:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rank as column in pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Rank-as-column-in-pivot-table/m-p/2520301#M106399</link>
      <description>&lt;P&gt;Oleg, Thank you very much!&amp;nbsp; That was it!&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 20:18:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rank-as-column-in-pivot-table/m-p/2520301#M106399</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2025-06-05T20:18:22Z</dc:date>
    </item>
  </channel>
</rss>

