<?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 in Pivot Table by Values when One of the Dimensions is Dragged into Horizontal Row in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-Table-by-Values-when-One-of-the-Dimensions-is/m-p/1659926#M730074</link>
    <description>&lt;P&gt;You could set it to sort by an expression instead of Y-value, and make the sort expression the same as what is used in the table, but add set analysis to only count the current year. If the expression in your table is "sum(Amount)", you would make the sort expression "sum({&amp;lt;TimePeriod={$(vMaxTimePeriod)}&amp;gt;} Amount)", where vMaxTimePeriod is a variable storing the max Time Period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can set vMaxTimePeriod in the load script with code similar to:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Temp_maxTimePeriod:
LOAD max(TimePeriod) as maxTimePeriod
Resident [your data table containing TimePeriod];

Let vMaxTimePeriod = Peek('maxTimePeriod');
Drop Table Temp_maxTimePeriod;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 20 Dec 2019 23:59:09 GMT</pubDate>
    <dc:creator>gavinlaird</dc:creator>
    <dc:date>2019-12-20T23:59:09Z</dc:date>
    <item>
      <title>Sorting in Pivot Table by Values when One of the Dimensions is Dragged into Horizontal Row</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-Table-by-Values-when-One-of-the-Dimensions-is/m-p/1658922#M730073</link>
      <description>&lt;P&gt;I have a Pivot Table, where there are Few Dimensions and Time Period Available. However, the visual representation of that will be in the below format:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sample.png" style="width: 919px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/25720i7AB24A28FC3CB515/image-size/large?v=v2&amp;amp;px=999" role="button" title="Sample.png" alt="Sample.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have Dragged the Year Time Period into Horizontal placement, which makes it easier to view the numbers across Time Period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I would like to Sort the Values by 2019. I tried by choosing 'Y-Value' as the Sort option. But the option considers the entire (2019+2018+2017+2016) instead of just 2019.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to achieve this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:40:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-Table-by-Values-when-One-of-the-Dimensions-is/m-p/1658922#M730073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T01:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot Table by Values when One of the Dimensions is Dragged into Horizontal Row</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-Table-by-Values-when-One-of-the-Dimensions-is/m-p/1659926#M730074</link>
      <description>&lt;P&gt;You could set it to sort by an expression instead of Y-value, and make the sort expression the same as what is used in the table, but add set analysis to only count the current year. If the expression in your table is "sum(Amount)", you would make the sort expression "sum({&amp;lt;TimePeriod={$(vMaxTimePeriod)}&amp;gt;} Amount)", where vMaxTimePeriod is a variable storing the max Time Period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can set vMaxTimePeriod in the load script with code similar to:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Temp_maxTimePeriod:
LOAD max(TimePeriod) as maxTimePeriod
Resident [your data table containing TimePeriod];

Let vMaxTimePeriod = Peek('maxTimePeriod');
Drop Table Temp_maxTimePeriod;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 23:59:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-Table-by-Values-when-One-of-the-Dimensions-is/m-p/1659926#M730074</guid>
      <dc:creator>gavinlaird</dc:creator>
      <dc:date>2019-12-20T23:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting in Pivot Table by Values when One of the Dimensions is Dragged into Horizontal Row</title>
      <link>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-Table-by-Values-when-One-of-the-Dimensions-is/m-p/1660302#M730075</link>
      <description>&lt;P&gt;Did the post help you with things?&amp;nbsp; If so, be sure to return to things and use the Accept as Solution button to give the poster credit for the assistance and let other Community Members know what worked.&amp;nbsp; They are definitely on the right track with things, I am going to include a link to the Design Blog area for you in case you want to further search there, might want to have a look at some of the Set Analysis posts there I think.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 20:10:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sorting-in-Pivot-Table-by-Values-when-One-of-the-Dimensions-is/m-p/1660302#M730075</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-12-23T20:10:46Z</dc:date>
    </item>
  </channel>
</rss>

