<?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: Stacked Bar Chart Sort Order in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181352#M21841</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems to me that most likely your problem to sort the bar segments is not as simple, but I think I need to tell you how I solved my sorting issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My measures did not have any order. For certain data sets, if I turned off the Auto Sort in the chart, that was enough because they were loaded by the script in order of appearance. But for a certain stacked bar chart that involves a CrossTable feature at load script, this was not working. As I said above, moving around columns in my data set helped a bit but unpredictably. I really needed to make it work, so I added a number to my data set dimensions in front and used the Sorting feature of the chart in Alphabetical order. And it worked just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I went through a lot of scripting try-and-fail, many weeks of that... generated the charts in many different ways, but the simplest of solutions was there a bit hidden and I could not see it from the very beginning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said, this might not be possible for you, but it worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Nov 2016 17:50:01 GMT</pubDate>
    <dc:creator>demonioazul</dc:creator>
    <dc:date>2016-11-04T17:50:01Z</dc:date>
    <item>
      <title>Stacked Bar Chart Sort Order</title>
      <link>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181350#M21839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a stacked bar chart that looks like this&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/137154_Capture.PNG" style="width: 620px; height: 269px;" /&gt;&lt;/P&gt;&lt;P&gt;I really want to order the colours so they are in numerical order.&amp;nbsp; So we start with "&amp;lt;=80%", then "-80 to 60%" etc, ending up with "&amp;gt;=+80%".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have uploaded my bands as a separate table as I am doing an Interval Match on the value, so I added a column for DiscountBandSortOrder, but I cant seem to get it to work.&amp;nbsp; The Dimensions for the chart are Underwriter and Discount Band and the formula for the Measure is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;QuoteSystemStatus={'Issued','Finalised'},DateFirstQuoteReceived={'&amp;gt;=$(=addmonths(max(DateFirstQuoteReceived),-3))'}&amp;gt;}QuoteID) /&lt;/P&gt;&lt;P&gt;count(total&amp;lt;Underwriter&amp;gt;{$&amp;lt;QuoteSystemStatus={'Issued','Finalised'},DateFirstQuoteReceived={'&amp;gt;=$(=addmonths(max(DateFirstQuoteReceived),-3))'}&amp;gt;}QuoteID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it counts % of the number of QuoteIDs in each DiscountBand compared to the total for that Underwriter in the last 3 months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I use for the expression in the Sort section to get the right order?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Sep 2016 16:32:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181350#M21839</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-12T16:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar Chart Sort Order</title>
      <link>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181351#M21840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same issue... I have tried to even change the sequence in which data is loaded by the script, modified my data tables in Excel... it seems there is no way for the chart developer on how to change the sequence of the segments of the stacked bar are displayed.&lt;/P&gt;&lt;P&gt;I have played also with the Sorting feature for each dimension, it helped a bit but&amp;nbsp; it never ends up in a logical way... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2016 13:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181351#M21840</guid>
      <dc:creator>demonioazul</dc:creator>
      <dc:date>2016-11-04T13:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar Chart Sort Order</title>
      <link>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181352#M21841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems to me that most likely your problem to sort the bar segments is not as simple, but I think I need to tell you how I solved my sorting issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My measures did not have any order. For certain data sets, if I turned off the Auto Sort in the chart, that was enough because they were loaded by the script in order of appearance. But for a certain stacked bar chart that involves a CrossTable feature at load script, this was not working. As I said above, moving around columns in my data set helped a bit but unpredictably. I really needed to make it work, so I added a number to my data set dimensions in front and used the Sorting feature of the chart in Alphabetical order. And it worked just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I went through a lot of scripting try-and-fail, many weeks of that... generated the charts in many different ways, but the simplest of solutions was there a bit hidden and I could not see it from the very beginning.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I said, this might not be possible for you, but it worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2016 17:50:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181352#M21841</guid>
      <dc:creator>demonioazul</dc:creator>
      <dc:date>2016-11-04T17:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar Chart Sort Order</title>
      <link>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181353#M21842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;See this approach using match fonction :&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/thread/235804"&gt;https://community.qlik.com/thread/235804&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add this in sortorder panel :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;match(YourDimension,'&amp;lt;=80%','-80 to 60%','-60 to 80%','-40 to 60%','-20 to 40%','etc','etc' ... ) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Nov 2016 11:52:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181353#M21842</guid>
      <dc:creator>brunobertels</dc:creator>
      <dc:date>2016-11-05T11:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar Chart Sort Order</title>
      <link>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181354#M21843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try using a calculated dimension using the dual function so you can sort the dimension numerically. See attached example.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Nov 2016 15:23:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181354#M21843</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-11-06T15:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar Chart Sort Order</title>
      <link>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181355#M21844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Bruno!&lt;/P&gt;&lt;P&gt;I used that match function to generate the order but somehow it did not work with one of the bar segments, no idea why. &lt;/P&gt;&lt;P&gt;My last resource was to modify the name of the measures and that worked perfectly. As I said, not optimal, but it worked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 14:49:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181355#M21844</guid>
      <dc:creator>demonioazul</dc:creator>
      <dc:date>2016-11-07T14:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Stacked Bar Chart Sort Order</title>
      <link>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181356#M21845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow, Gysbert!&lt;BR /&gt;That was an elegant way to solve it!&lt;/P&gt;&lt;P&gt;However, that is not yet my level - I need to study more to understand how you achieved that with only just a few lines...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; dual(&lt;/P&gt;&lt;P&gt;&amp;nbsp; only(Customer)&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,sum(Amount)&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;,Year,Customer)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(BTW, I did not post this question, so I cannot mark it as solved)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2016 14:57:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Stacked-Bar-Chart-Sort-Order/m-p/1181356#M21845</guid>
      <dc:creator>demonioazul</dc:creator>
      <dc:date>2016-11-07T14:57:51Z</dc:date>
    </item>
  </channel>
</rss>

