<?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: pivot table sorting in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473161#M99847</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;lennart_mo,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I entered the expression &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;sum({&amp;lt; Year={"$(=max(Year))"} &amp;gt;} Sales)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;for sorting each dimension but it only works with respect to the first dimension&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 08:59:02 GMT</pubDate>
    <dc:creator>stefano_marson</dc:creator>
    <dc:date>2024-07-26T08:59:02Z</dc:date>
    <item>
      <title>pivot table sorting</title>
      <link>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473052#M99838</link>
      <description>&lt;P&gt;Hello Gurus,&lt;/P&gt;
&lt;P&gt;On Qlik Sense on-premise version November 2023, I would need to set the row dimension sorting of a &lt;STRONG&gt;pivot table&lt;/STRONG&gt; by the measure (&lt;EM&gt;sum(Sales)&lt;/EM&gt;) calculated &lt;U&gt;only on the maximum available Year&lt;/U&gt;. The column dimension (Year) on the other hand needs to maintain numerical sorting.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="stefano_marson_0-1721925454946.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169950i296F203BA0028DD3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="stefano_marson_0-1721925454946.png" alt="stefano_marson_0-1721925454946.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The option that allows sorting against the first measure of a pivot table only works if there is only one Year selected.&lt;/P&gt;
&lt;P&gt;I also tried defining a first measure, to be used only for sorting, of the type:&lt;/P&gt;
&lt;P&gt;&lt;U&gt;sum({&amp;lt; Year={‘$(=max(Year))’} &amp;gt;} Sales)&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;but it doesn't work.&lt;/P&gt;
&lt;P&gt;Notes:&lt;/P&gt;
&lt;P&gt;- Dimensions in row can change position (e.g., Item before Store), but cannot be moved to columns.&lt;/P&gt;
&lt;P&gt;- All combinations of dimensions in row have sales, i.e. &lt;EM&gt;sum(Sales) &amp;gt; 0&lt;/EM&gt;, over all years&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any thoughts?&lt;/P&gt;
&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 16:38:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473052#M99838</guid>
      <dc:creator>stefano_marson</dc:creator>
      <dc:date>2024-07-25T16:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: pivot table sorting</title>
      <link>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473150#M99845</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/44183"&gt;@stefano_marson&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;under sorting there should be the option to switch to custom for every dimension. If you do so, you can add an expression to sort by. Your original expression wasn't all wrong except you didn't use double qoutes.&lt;/P&gt;
&lt;P&gt;Try using this expression for your row dimensions:&lt;/P&gt;
&lt;P&gt;=sum({&amp;lt; Year={"$(=max(Year))"} &amp;gt;} Sales)&lt;/P&gt;
&lt;P&gt;Let me know, if this worked for you!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 08:07:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473150#M99845</guid>
      <dc:creator>lennart_mo</dc:creator>
      <dc:date>2024-07-26T08:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: pivot table sorting</title>
      <link>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473161#M99847</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;lennart_mo,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I entered the expression &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;sum({&amp;lt; Year={"$(=max(Year))"} &amp;gt;} Sales)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;for sorting each dimension but it only works with respect to the first dimension&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 08:59:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473161#M99847</guid>
      <dc:creator>stefano_marson</dc:creator>
      <dc:date>2024-07-26T08:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: pivot table sorting</title>
      <link>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473221#M99861</link>
      <description>&lt;P&gt;Hi Stefano,&lt;/P&gt;
&lt;P&gt;It seems that using the expression in sorting Qlik disregards the structure of the pivot table.&lt;BR /&gt;In regards to your example table that results in the following:&lt;/P&gt;
&lt;P&gt;Looking at the dimension departments as the second dimension:&lt;BR /&gt;Instead of calculating the sum for a distinct store, the total amount of sales by a department for all stores is calculated. This results in a sorting as if the department was the first dimension.&lt;/P&gt;
&lt;P&gt;Unfortunately I haven't found a way to correct the sorting formula so far.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 12:16:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/pivot-table-sorting/m-p/2473221#M99861</guid>
      <dc:creator>lennart_mo</dc:creator>
      <dc:date>2024-07-26T12:16:13Z</dc:date>
    </item>
  </channel>
</rss>

