<?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: Line chart sorting for legend dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796865#M64415</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp; Unfortunately, this doesn't help at all. This issue here isn't to set a specific order for currencies - I'm looking for a simple alphabetical sort - but to have Qlik sort them in a consistent manner that doesn't change based on the values of the actual measure.&lt;/P&gt;&lt;P&gt;Near as I can tell, the issue appears to be that Qlik is sorting first based on month, and since GBP has no value for Month = 1, it's getting sorted behind the other currencies. Changing the currency dimension itself doesn't seem to modify this behavior in any way, including adding dual().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Apr 2021 12:48:00 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2021-04-05T12:48:00Z</dc:date>
    <item>
      <title>Line chart sorting for legend dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796861#M64413</link>
      <description>&lt;P&gt;The issue I am facing is trying to sort the legend dimension in a line chart alphabetically without upsetting the X-axis sorting, in a context where some legend dimensions start later on the X axis than others.&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;P&gt;Load * INLINE [&lt;BR /&gt;Currency, Month, Value, Filter&lt;BR /&gt;EUR, 1, 100, A&lt;BR /&gt;EUR, 2, 300, A&lt;BR /&gt;EUR, 3, 400, A&lt;BR /&gt;USD, 1, 200, A&lt;BR /&gt;USD, 3, 500, B&lt;BR /&gt;GBP, 2, 250, B&lt;BR /&gt;GBP, 3, 600, A&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;My line chart is composed of Month as the X-axis dimension, Currency as the legend dimension, and the measure expression:&lt;/P&gt;&lt;P&gt;Sum({&amp;lt; Filter = {"A"} &amp;gt;} Value)&lt;/P&gt;&lt;P&gt;When sorting by Month and then by Currency (alphabetically), instead of getting EUR-GBP-USD, I get this chart with USD ahead of GBP:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1617623385912.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52353i9EB0C7FBBA13DEF6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1617623385912.png" alt="Or_0-1617623385912.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The reason being, presumably, that GBP has no values for Months 1 or 2 whereas USD and EUR do, so they are getting sorted ahead of GBP.&lt;/P&gt;&lt;P&gt;I'm looking for any sort of workaround or method where the values would get sorted correctly - first by month (so the X-axis remains correct) and then by currency (alphabetically). This is a simplistic example - the actual formula used has multiple aggregations and more complex set analysis.&lt;/P&gt;&lt;P&gt;Solutions already attempted without success:&lt;/P&gt;&lt;P&gt;Move the currency to first on the sort list (breaks the sorting by months on the X axis)&lt;/P&gt;&lt;P&gt;Sorting the second dimension by e.g. Only({1} Currency)&lt;/P&gt;&lt;P&gt;Sorting by load order&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would appreciate any insights or ideas... thanks in advance!&lt;/P&gt;&lt;P&gt;[Edit]&lt;/P&gt;&lt;P&gt;Attached is the app used to generate this sample&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 12:47:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796861#M64413</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-04-05T12:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart sorting for legend dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796863#M64414</link>
      <description>&lt;P&gt;Try creating a master dimension with dual(), something like:&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;=Dual(Currency, Match(Currency, 'EUR', 'GBP', 'USD'))&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Then use this dimension for chart coloring. You might want to set your colors in master dimension if anything specific.&lt;/P&gt;&lt;P&gt;Credit: Patrik Lundblad&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 12:29:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796863#M64414</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-04-05T12:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart sorting for legend dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796865#M64415</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp; Unfortunately, this doesn't help at all. This issue here isn't to set a specific order for currencies - I'm looking for a simple alphabetical sort - but to have Qlik sort them in a consistent manner that doesn't change based on the values of the actual measure.&lt;/P&gt;&lt;P&gt;Near as I can tell, the issue appears to be that Qlik is sorting first based on month, and since GBP has no value for Month = 1, it's getting sorted behind the other currencies. Changing the currency dimension itself doesn't seem to modify this behavior in any way, including adding dual().&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 12:48:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796865#M64415</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-04-05T12:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart sorting for legend dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796871#M64417</link>
      <description>&lt;P&gt;I didn't go much deep into it. I saw :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tresesco_0-1617627217175.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52355i582FB8D6FD21F600/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tresesco_0-1617627217175.png" alt="tresesco_0-1617627217175.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 12:53:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796871#M64417</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-04-05T12:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart sorting for legend dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796884#M64419</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949"&gt;@tresB&lt;/a&gt;&amp;nbsp; I'm not sure how you arrived at that chart - using the exact formula you posted, I am not getting any change in the sort order on my end... it's still putting USD ahead of GBP. I've tried doing this both at the script level and as a master dimension and neither has resulted in any change to the sort order.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1617628522023.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52360iA771D02FFFA3EB6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1617628522023.png" alt="Or_0-1617628522023.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since your object looks different than mine, perhaps this is a cross-version issue? I'm looking at this on Qlik Sense April 2020 SR11 here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 13:23:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796884#M64419</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-04-05T13:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart sorting for legend dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796900#M64422</link>
      <description>&lt;P&gt;It seems that you are using&amp;nbsp; your master dimension as second dimension. Instead, use your actual Currency as second dimension and then drag your master dimension (CurrencyDual) for just coloring it (Color By :). That should work.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 13:48:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796900#M64422</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2021-04-05T13:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart sorting for legend dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796904#M64424</link>
      <description>&lt;P&gt;Oops, missed that part of your response - I think it's so counter-intuitive that the sort order of a dimension would be determined by the colors option being set to a dimension that's numeric that I just didn't pick up on it.&lt;/P&gt;&lt;P&gt;Sadly, I'm working with Vizlib Line Chart rather than the native object, and this option doesn't seem to exist in the Vizlib extension, and it also breaks down in the more complex scenario used in my formulas and set analysis (where the values displayed are excluded by the selection and then made available through set analysis) - all the lines are showing up gray. Back to the drawing board for me... but at least now I know how to get it done with the native version and simple case. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 14:08:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796904#M64424</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-04-05T14:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart sorting for legend dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796908#M64425</link>
      <description>&lt;P&gt;Just in case anyone comes across this again, for further information, here's what happens when a month is selected and the expression is modified with a set analysis of:&lt;/P&gt;&lt;P&gt;Month =&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_0-1617632116254.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52368i3C5C3035AE398D13/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_0-1617632116254.png" alt="Or_0-1617632116254.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When the coloring is removed, it goes back to showing the list of currencies, but again, the order is not correct:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Or_1-1617632225591.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/52369iD4478DDAB9B72BA3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Or_1-1617632225591.png" alt="Or_1-1617632225591.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this seems to be a case where the workaround applies only to a relatively simple use case but not more complex ones. Still, it is a good workaround when appropriate!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Apr 2021 14:17:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Line-chart-sorting-for-legend-dimension/m-p/1796908#M64425</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-04-05T14:17:34Z</dc:date>
    </item>
  </channel>
</rss>

