<?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: Sorting 2nd dimension Issue in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/2425197#M96072</link>
    <description>&lt;DIV id="resultArea"&gt;
&lt;P class="resultText"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;This solution doesn't work if you want to create a column share measure. &lt;BR /&gt;&lt;BR /&gt;I created a share expression:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;If(Dimensionality() = 1,
    Sum(Value) / Sum(Total Value)
    ,
    Sum(Value) / Sum(Total&amp;lt;Dim2&amp;gt; Value)
)&lt;/LI-CODE&gt;
&lt;P class="resultText"&gt;Unfortunately, I don't know how to correctly write the share of the second dimension in this table. I want the child row's share to be counted for the parent row.&amp;nbsp;&lt;SPAN&gt;Below is the table I would like to receive:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV id="resultArea"&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;2500&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;73.53%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp; B&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;1500&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&lt;STRIKE&gt;44,12%&lt;/STRIKE&gt;1500/2500=60%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp; A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;1000&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&lt;STRIKE&gt;29,41%&lt;/STRIKE&gt;1000/2500=40%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;B&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;900&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;26,47%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;...&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;..&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;..&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P class="candidateText"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="mediaButtons"&gt;
&lt;DIV class="copy"&gt;Of course, I could use this expression:&amp;nbsp;Sum(Value)/Sum(Total Value), but that's a solution for each row showing the overall share.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV id="resultArea"&gt;
&lt;P class="resultText"&gt;Thanks in advance.&lt;BUTTON class="listenButton" title="Listen"&gt;&lt;/BUTTON&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
    <pubDate>Thu, 29 Feb 2024 10:04:28 GMT</pubDate>
    <dc:creator>piter89</dc:creator>
    <dc:date>2024-02-29T10:04:28Z</dc:date>
    <item>
      <title>Sorting 2nd dimension Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/1558354#M40655</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm having issues to sort this pivot table (also a stacked bar chart).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorting shoud be: dates with higher KG_TOTAL and then routes operating on each date also sorted from high to low&lt;/P&gt;&lt;P&gt;&amp;nbsp;Day_Month sort order is working well, I use this expression:&lt;/P&gt;&lt;P&gt;rank(sum($(v.Aux_CYTD)&lt;BR /&gt;KG_TOTAL))&lt;/P&gt;&lt;P&gt;But I can't get route sort order to work as you can see:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="table.png" style="width: 413px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/8361i2EF89A9C7D699D30/image-size/large?v=v2&amp;amp;px=999" role="button" title="table.png" alt="table.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Which expression shoud I use to sort by second dimension (Route)?&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;Jose M.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 06:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/1558354#M40655</guid>
      <dc:creator>josemaria_cabre</dc:creator>
      <dc:date>2024-11-16T06:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting 2nd dimension Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/1558363#M40656</link>
      <description>&lt;P&gt;Hi, field values are sorted globally, so if 'AMS-MAD' it's the second across all dimensions it will show the second in all dimensions, because that's the sort index for that field value.&lt;/P&gt;&lt;P&gt;One workaround to this can be using a calculated dimension that gives a different value to each dimension combination. PFA.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2019 10:46:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/1558363#M40656</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2019-03-19T10:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting 2nd dimension Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/1558411#M40661</link>
      <description>&lt;P&gt;Hi Ruben,&lt;/P&gt;&lt;P&gt;It works perfect with your solution&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ps.&lt;/P&gt;&lt;P&gt;I haven't seen this expression on Dim2 before:&lt;/P&gt;&lt;P&gt;=Aggr(Dual(Dim2, RowNo(TOTAL)), Dim1, Dim2)&lt;/P&gt;&lt;P&gt;Thanks for your 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;</description>
      <pubDate>Tue, 19 Mar 2019 14:35:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/1558411#M40661</guid>
      <dc:creator>josemaria_cabre</dc:creator>
      <dc:date>2019-03-19T14:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting 2nd dimension Issue</title>
      <link>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/2425197#M96072</link>
      <description>&lt;DIV id="resultArea"&gt;
&lt;P class="resultText"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;This solution doesn't work if you want to create a column share measure. &lt;BR /&gt;&lt;BR /&gt;I created a share expression:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;If(Dimensionality() = 1,
    Sum(Value) / Sum(Total Value)
    ,
    Sum(Value) / Sum(Total&amp;lt;Dim2&amp;gt; Value)
)&lt;/LI-CODE&gt;
&lt;P class="resultText"&gt;Unfortunately, I don't know how to correctly write the share of the second dimension in this table. I want the child row's share to be counted for the parent row.&amp;nbsp;&lt;SPAN&gt;Below is the table I would like to receive:&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV id="resultArea"&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;2500&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;73.53%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp; B&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;1500&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&lt;STRIKE&gt;44,12%&lt;/STRIKE&gt;1500/2500=60%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&amp;nbsp; A&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;1000&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;&lt;STRIKE&gt;29,41%&lt;/STRIKE&gt;1000/2500=40%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;B&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;900&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;26,47%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;...&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;..&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;..&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P class="candidateText"&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="mediaButtons"&gt;
&lt;DIV class="copy"&gt;Of course, I could use this expression:&amp;nbsp;Sum(Value)/Sum(Total Value), but that's a solution for each row showing the overall share.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;
&lt;DIV id="resultArea"&gt;
&lt;P class="resultText"&gt;Thanks in advance.&lt;BUTTON class="listenButton" title="Listen"&gt;&lt;/BUTTON&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 29 Feb 2024 10:04:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-Issue/m-p/2425197#M96072</guid>
      <dc:creator>piter89</dc:creator>
      <dc:date>2024-02-29T10:04:28Z</dc:date>
    </item>
  </channel>
</rss>

