<?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 Changing the row sequence in pivot table. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Changing-the-row-sequence-in-pivot-table/m-p/356011#M132134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you not sort by your Rank() expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 May 2012 07:43:55 GMT</pubDate>
    <dc:creator>Jason_Michaelides</dc:creator>
    <dc:date>2012-05-17T07:43:55Z</dc:date>
    <item>
      <title>Changing the row sequence in pivot table.</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-the-row-sequence-in-pivot-table/m-p/356010#M132133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please consider following scenario:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 1000 rows of Customer names in dimension table and I have taken top 50 customer names and order amount (field in fact table) sorted on the basis of their order amount in one pivot table. I have calculated top 50 order amount total in the same pivot table using rank and aggregate functions .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Following is the expression:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;if(RowNo&lt;A&gt;&lt;/A&gt;()&amp;gt;0,sum&lt;A&gt;&lt;/A&gt;({$&amp;lt;QTR_NBR&lt;A&gt;&lt;/A&gt;={1},YEAR_CD&lt;A&gt;&lt;/A&gt;={'P'},TREND_CAT_CD&lt;A&gt;&lt;/A&gt;={'HI'}&amp;gt;}ORDR_AMT&lt;A&gt;&lt;/A&gt;),&lt;/P&gt;&lt;P&gt;sum(if(aggr&lt;A&gt;&lt;/A&gt;(rank(sum(ORDR_AMT&lt;A&gt;&lt;/A&gt;),4),CUST_NAME&lt;A&gt;&lt;/A&gt;)&amp;lt;51,aggr&lt;A&gt;&lt;/A&gt;(sum({$&amp;lt;QTR_NBR&lt;A&gt;&lt;/A&gt;={1},YEAR_CD&lt;A&gt;&lt;/A&gt;={'P'},TREND_CAT_CD&lt;A&gt;&lt;/A&gt;={'HI'}&amp;gt;}ORDR_AMT&lt;A&gt;&lt;/A&gt;),CUST_NAME&lt;A&gt;&lt;/A&gt;))))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and following is the dimension :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;= aggr&lt;A&gt;&lt;/A&gt;(if(rank(sum({$&amp;lt;QTR_NBR&lt;A&gt;&lt;/A&gt;={4},YEAR_CD&lt;A&gt;&lt;/A&gt;={'C'},TREND_CAT_CD&lt;A&gt;&lt;/A&gt;={'HI'}&amp;gt;}ALWD_AMT&lt;A&gt;&lt;/A&gt;),4)&amp;lt;51,CUST_NAME&lt;A&gt;&lt;/A&gt;),CUST_NAME&lt;A&gt;&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also calculated All others total (1000-50 = 950 total) using partial sum feature of the pivot table. This is giving me a pivot table having rows:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Top 50 customer names (50 rows)&lt;/P&gt;&lt;P&gt;All others total&lt;/P&gt;&lt;P&gt;Top50 Total&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while our client wants it in following way:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Top 50 customer names (50 rows)&lt;/P&gt;&lt;P&gt;Top50 Total&lt;/P&gt;&lt;P&gt;All others total&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not able to swap last two total rows in any way in my pivot. Can you please help me out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kirti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 06:53:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-the-row-sequence-in-pivot-table/m-p/356010#M132133</guid>
      <dc:creator />
      <dc:date>2012-05-17T06:53:58Z</dc:date>
    </item>
    <item>
      <title>Changing the row sequence in pivot table.</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-the-row-sequence-in-pivot-table/m-p/356011#M132134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you not sort by your Rank() expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 07:43:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-the-row-sequence-in-pivot-table/m-p/356011#M132134</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-05-17T07:43:55Z</dc:date>
    </item>
    <item>
      <title>Changing the row sequence in pivot table.</title>
      <link>https://community.qlik.com/t5/QlikView/Changing-the-row-sequence-in-pivot-table/m-p/356012#M132135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Nopes... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2012 10:36:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Changing-the-row-sequence-in-pivot-table/m-p/356012#M132135</guid>
      <dc:creator />
      <dc:date>2012-05-17T10:36:54Z</dc:date>
    </item>
  </channel>
</rss>

