<?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 Sorting 2nd dimension and share - a simple task without a solution in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-and-share-a-simple-task-without-a-solution/m-p/2429634#M96447</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a problem with sorting the second dimension and the share of&amp;nbsp;&lt;SPAN&gt;expanded&lt;/SPAN&gt; rows in a pivot table. I had to use&amp;nbsp;&lt;SPAN&gt;a calculated dimension for the second dimension. This gives me the ability to sort in the right order.&amp;nbsp;&lt;BR /&gt;My data:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD * Inline [
 Dim1,    Dim2,   Value
 Germany, Diesel, 1200
 Germany, Petrol, 1500
 France,  Diesel, 800
 France,  Petrol, 300
]&lt;/LI-CODE&gt;
&lt;P&gt;My pivot table:&lt;/P&gt;
&lt;TABLE border="1" width="584px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;Dim1&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;=Aggr(Dual(Dim2, RowNo(TOTAL)), Dim1, Dim2)&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;Sum(Value)&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;Share&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;France&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;1100&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;28.95%&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;Diesel&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;800&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;&lt;STRIKE&gt;&lt;FONT color="#FF0000"&gt;21,05%&lt;/FONT&gt;&lt;BR /&gt;&lt;/STRIKE&gt;800/1100 = &lt;FONT color="#339966"&gt;72,73%&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;Petrol&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;300&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;&lt;STRIKE&gt;&lt;FONT color="#FF0000"&gt;7,89%&lt;/FONT&gt;&lt;BR /&gt;&lt;/STRIKE&gt;300/1100 = &lt;FONT color="#339966"&gt;27,27%&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;Germany&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;2700&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;71,05%&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;Petrol&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;1500&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;...&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;Diesel&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;1200&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;...&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Unfortunately, after applying a calculated dimension, I have an issue with the row share.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I can calculate the total market share, but&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I want to calculate the share of expanded rows in the parent row.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My expression for share measure:&lt;BR /&gt;&lt;/SPAN&gt;&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&gt;&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;This expression returns 100% for expanded rows. This works fine, if I change the calculated dimension to a normal dimension, but I lose the correct order of expanded rows.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2024 08:09:14 GMT</pubDate>
    <dc:creator>piter89</dc:creator>
    <dc:date>2024-03-12T08:09:14Z</dc:date>
    <item>
      <title>Sorting 2nd dimension and share - a simple task without a solution</title>
      <link>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-and-share-a-simple-task-without-a-solution/m-p/2429634#M96447</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a problem with sorting the second dimension and the share of&amp;nbsp;&lt;SPAN&gt;expanded&lt;/SPAN&gt; rows in a pivot table. I had to use&amp;nbsp;&lt;SPAN&gt;a calculated dimension for the second dimension. This gives me the ability to sort in the right order.&amp;nbsp;&lt;BR /&gt;My data:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOAD * Inline [
 Dim1,    Dim2,   Value
 Germany, Diesel, 1200
 Germany, Petrol, 1500
 France,  Diesel, 800
 France,  Petrol, 300
]&lt;/LI-CODE&gt;
&lt;P&gt;My pivot table:&lt;/P&gt;
&lt;TABLE border="1" width="584px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;Dim1&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;=Aggr(Dual(Dim2, RowNo(TOTAL)), Dim1, Dim2)&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;Sum(Value)&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;Share&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;France&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;1100&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;28.95%&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;Diesel&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;800&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;&lt;STRIKE&gt;&lt;FONT color="#FF0000"&gt;21,05%&lt;/FONT&gt;&lt;BR /&gt;&lt;/STRIKE&gt;800/1100 = &lt;FONT color="#339966"&gt;72,73%&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;Petrol&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;300&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;&lt;STRIKE&gt;&lt;FONT color="#FF0000"&gt;7,89%&lt;/FONT&gt;&lt;BR /&gt;&lt;/STRIKE&gt;300/1100 = &lt;FONT color="#339966"&gt;27,27%&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;Germany&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;2700&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;71,05%&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;Petrol&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;1500&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;...&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="84.0104px" height="24px"&gt;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="139.156px" height="24px"&gt;Diesel&lt;/TD&gt;
&lt;TD width="142.479px" height="24px"&gt;1200&lt;/TD&gt;
&lt;TD width="170.427px" height="24px"&gt;...&lt;/TD&gt;
&lt;TD width="47.2604px"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Unfortunately, after applying a calculated dimension, I have an issue with the row share.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I can calculate the total market share, but&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I want to calculate the share of expanded rows in the parent row.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;My expression for share measure:&lt;BR /&gt;&lt;/SPAN&gt;&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&gt;&lt;SPAN&gt;&amp;nbsp;&lt;BR /&gt;This expression returns 100% for expanded rows. This works fine, if I change the calculated dimension to a normal dimension, but I lose the correct order of expanded rows.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2024 08:09:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-and-share-a-simple-task-without-a-solution/m-p/2429634#M96447</guid>
      <dc:creator>piter89</dc:creator>
      <dc:date>2024-03-12T08:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting 2nd dimension and share - a simple task without a solution</title>
      <link>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-and-share-a-simple-task-without-a-solution/m-p/2429654#M96456</link>
      <description>&lt;LI-CODE lang="markup"&gt;Column(1) / Pick(Dimensionality(),
	Sum(total Value),
    Only(Aggr(Sum(total &amp;lt;Dim1&amp;gt; Value), Dim1, Dim2))
)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 12 Mar 2024 08:55:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sorting-2nd-dimension-and-share-a-simple-task-without-a-solution/m-p/2429654#M96456</guid>
      <dc:creator>LRuCelver</dc:creator>
      <dc:date>2024-03-12T08:55:19Z</dc:date>
    </item>
  </channel>
</rss>

