<?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 Help with coloring using a ranked dimension in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Help-with-coloring-using-a-ranked-dimension/m-p/1452836#M35617</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is my data set:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;One table with Customers, Years, Sales Regions, Business Areas and their Revenue (see attached Sales.xlsx).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is my goal:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Building a stacked bar chart with one bar per year. Each stack represents the Top 3, Top 4+5 and Others customers based on their revenue in 2017.&lt;/P&gt;&lt;P&gt;In other words, I want to determine the Top 3 customers based on their revenue in 2017 and then also show their combined revenue in 2016, even if they would not be the Top 3 in that year.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Snapshot.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/182912_Snapshot.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to put together a formula for the dimension that works:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15103733144114594" jivemacro_uid="_15103733144114594"&gt;
&lt;P&gt;=Aggr( If(Rank(Aggr(Sum({&amp;lt;Year={2017}&amp;gt;} Revenue),[Customer ID])) &amp;lt;= 3, Dual('Top 3',3),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Rank(Aggr(Sum({&amp;lt;Year={2017}&amp;gt;} Revenue),[Customer ID])) &amp;lt;= 5, Dual('Next 2',5),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual('Others',99)))&lt;/P&gt;
&lt;P&gt;,[Customer ID])&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;And finally my problem:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I can't see to find the correct formula for defining the colors for the three bands.&lt;/P&gt;&lt;P&gt;In Sense, everything is displayed in gray. Playing around with the formula above only affects the stacks for 2016.&lt;/P&gt;&lt;P&gt;I also attached the app, hoping that someone can solve this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Btw., I tried the same in QlikView and although QlikView is displaying colors, I cannot manually overwrite them nor are they persistent (even using the option in the Color tab)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Nov 2017 04:14:20 GMT</pubDate>
    <dc:creator>bhorneber</dc:creator>
    <dc:date>2017-11-11T04:14:20Z</dc:date>
    <item>
      <title>Help with coloring using a ranked dimension</title>
      <link>https://community.qlik.com/t5/App-Development/Help-with-coloring-using-a-ranked-dimension/m-p/1452836#M35617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is my data set:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;One table with Customers, Years, Sales Regions, Business Areas and their Revenue (see attached Sales.xlsx).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This is my goal:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Building a stacked bar chart with one bar per year. Each stack represents the Top 3, Top 4+5 and Others customers based on their revenue in 2017.&lt;/P&gt;&lt;P&gt;In other words, I want to determine the Top 3 customers based on their revenue in 2017 and then also show their combined revenue in 2016, even if they would not be the Top 3 in that year.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Snapshot.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/182912_Snapshot.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to put together a formula for the dimension that works:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_15103733144114594" jivemacro_uid="_15103733144114594"&gt;
&lt;P&gt;=Aggr( If(Rank(Aggr(Sum({&amp;lt;Year={2017}&amp;gt;} Revenue),[Customer ID])) &amp;lt;= 3, Dual('Top 3',3),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Rank(Aggr(Sum({&amp;lt;Year={2017}&amp;gt;} Revenue),[Customer ID])) &amp;lt;= 5, Dual('Next 2',5),&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dual('Others',99)))&lt;/P&gt;
&lt;P&gt;,[Customer ID])&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;And finally my problem:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;I can't see to find the correct formula for defining the colors for the three bands.&lt;/P&gt;&lt;P&gt;In Sense, everything is displayed in gray. Playing around with the formula above only affects the stacks for 2016.&lt;/P&gt;&lt;P&gt;I also attached the app, hoping that someone can solve this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Btw., I tried the same in QlikView and although QlikView is displaying colors, I cannot manually overwrite them nor are they persistent (even using the option in the Color tab)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Nov 2017 04:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Help-with-coloring-using-a-ranked-dimension/m-p/1452836#M35617</guid>
      <dc:creator>bhorneber</dc:creator>
      <dc:date>2017-11-11T04:14:20Z</dc:date>
    </item>
  </channel>
</rss>

