<?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 Problem with pivot sort using set analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Problem-with-pivot-sort-using-set-analysis/m-p/1690874#M52790</link>
    <description>&lt;P&gt;Hi I'm have an issue with sorting in a pivot table.&amp;nbsp; The table uses months for the columns and I would like the sort to be by the row values in the earliest month.&amp;nbsp; The measures are all calculating correctly, it is just the sort that is an issue.&amp;nbsp; In the example below, the two highlighted&amp;nbsp; rows should be reversed.&amp;nbsp; Below is the current sort expression, I understand what it is doing because it is calculating the count for the entire set of data, so when taking that into account, the order is correct.&lt;/P&gt;&lt;P&gt;Sort expression:&lt;/P&gt;&lt;P&gt;=Count(distinct {$&amp;lt;[Validity Component Result] = {'Abnormal'}, [Validity Test] = {'X'}&amp;gt;} [Order#])&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pivot Sort on Count.JPG" style="width: 954px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/31256iC3B65C0FFB9F1BE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pivot Sort on Count.JPG" alt="Pivot Sort on Count.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I changed the sort expression to the one below adding to the set analysis to take the min value of the month (bold text)&lt;/P&gt;&lt;P&gt;=Count(distinct {$&amp;lt;[Validity Component Result] = {'Abnormal'}, [Validity Test] = {'X'}, &lt;STRONG&gt;[Month Starting]= {"$(=Min([Month Starting]))"}&lt;/STRONG&gt;&amp;gt;} [Order#])&lt;/P&gt;&lt;P&gt;But this gives the following result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pivot sort with min month.JPG" style="width: 962px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/31257iD31AB334BABEA711/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pivot sort with min month.JPG" alt="Pivot sort with min month.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think this may be happening because it has a problem with the expression overall and is defaulting to something else.&lt;/P&gt;&lt;P&gt;Thanks in advance for any input / help.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Apr 2020 18:44:47 GMT</pubDate>
    <dc:creator>wayne-a</dc:creator>
    <dc:date>2020-04-03T18:44:47Z</dc:date>
    <item>
      <title>Problem with pivot sort using set analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-pivot-sort-using-set-analysis/m-p/1690874#M52790</link>
      <description>&lt;P&gt;Hi I'm have an issue with sorting in a pivot table.&amp;nbsp; The table uses months for the columns and I would like the sort to be by the row values in the earliest month.&amp;nbsp; The measures are all calculating correctly, it is just the sort that is an issue.&amp;nbsp; In the example below, the two highlighted&amp;nbsp; rows should be reversed.&amp;nbsp; Below is the current sort expression, I understand what it is doing because it is calculating the count for the entire set of data, so when taking that into account, the order is correct.&lt;/P&gt;&lt;P&gt;Sort expression:&lt;/P&gt;&lt;P&gt;=Count(distinct {$&amp;lt;[Validity Component Result] = {'Abnormal'}, [Validity Test] = {'X'}&amp;gt;} [Order#])&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pivot Sort on Count.JPG" style="width: 954px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/31256iC3B65C0FFB9F1BE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pivot Sort on Count.JPG" alt="Pivot Sort on Count.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I changed the sort expression to the one below adding to the set analysis to take the min value of the month (bold text)&lt;/P&gt;&lt;P&gt;=Count(distinct {$&amp;lt;[Validity Component Result] = {'Abnormal'}, [Validity Test] = {'X'}, &lt;STRONG&gt;[Month Starting]= {"$(=Min([Month Starting]))"}&lt;/STRONG&gt;&amp;gt;} [Order#])&lt;/P&gt;&lt;P&gt;But this gives the following result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pivot sort with min month.JPG" style="width: 962px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/31257iD31AB334BABEA711/image-size/large?v=v2&amp;amp;px=999" role="button" title="Pivot sort with min month.JPG" alt="Pivot sort with min month.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think this may be happening because it has a problem with the expression overall and is defaulting to something else.&lt;/P&gt;&lt;P&gt;Thanks in advance for any input / help.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 18:44:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-pivot-sort-using-set-analysis/m-p/1690874#M52790</guid>
      <dc:creator>wayne-a</dc:creator>
      <dc:date>2020-04-03T18:44:47Z</dc:date>
    </item>
  </channel>
</rss>

