<?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 Dynamic coloring in pivot table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Dynamic-coloring-in-pivot-table/m-p/1993139#M82186</link>
    <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;I have coloring problem and I hope someone can find the problem.&lt;/P&gt;
&lt;P&gt;What i want to achieve is, that positive value are colored, based on their rank from a light green to a dark green, while negative figures are colored from a light red to a dark red, based on their rank (zero = white).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Costa_1-1665992383525.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91414iF9DBCED392EA6D82/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Costa_1-1665992383525.png" alt="Costa_1-1665992383525.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, this pivot table is based on an unbalanced hierarchy. In order to prevent collapsing levels that are empty, I needed to bring in some logics.&lt;/P&gt;
&lt;P&gt;I took the same calculation logic into the colormix1 (rank..)) function for the background coloring.&lt;/P&gt;
&lt;P&gt;Unfortunatly it does not really work. Negative values are red and positives green, but there is no real color grading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the following coding - ich believe the problem roots from the 'noofrows(total)', but i can't fix it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If ( LVL1='Market Performance' and Dimensionality()='1' or&lt;BR /&gt;LVL1='Profit contribution' and Dimensionality()='1'or&lt;BR /&gt;LVL1='Operative Income I' and Dimensionality()='1'or&lt;BR /&gt;LVL1='Operative Income II'and Dimensionality()='1' or&lt;BR /&gt;LVL1='Operative Income III' and Dimensionality()='1'or&lt;BR /&gt;LVL1='Operative Income IV'and Dimensionality()='1'&lt;BR /&gt;, rgb(0,37,62)&lt;BR /&gt;, if ( if ( not ( ( Isnull(LVL6) and dimensionality()=6 ) or&lt;BR /&gt;( Isnull(LVL5) and dimensionality()=5 ) or&lt;BR /&gt;( Isnull(LVL4) and dimensionality()=4 ) or&lt;BR /&gt;( Isnull(LVL3) and dimensionality()=3 ) or&lt;BR /&gt;( Isnull(LVL2) and dimensionality()=2 ) or &lt;BR /&gt;( Isnull(LVL1) and dimensionality()=1 )&amp;nbsp;&amp;nbsp;&lt;BR /&gt;)&lt;BR /&gt;, RangeSum ( Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'cost'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl*-1/1000000)&lt;BR /&gt;, Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'earning'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl/1000000))&lt;BR /&gt;&lt;BR /&gt;) &amp;lt;= 0&lt;BR /&gt;, ColorMix1 ( Rank ( total if ( not ( ( Isnull(LVL6) and dimensionality()=6 ) or&lt;BR /&gt;( Isnull(LVL5) and dimensionality()=5 ) or&lt;BR /&gt;( Isnull(LVL4) and dimensionality()=4 ) or&lt;BR /&gt;( Isnull(LVL3) and dimensionality()=3 ) or&lt;BR /&gt;( Isnull(LVL2) and dimensionality()=2 ) or &lt;BR /&gt;( Isnull(LVL1) and dimensionality()=1 )&amp;nbsp;&amp;nbsp;&lt;BR /&gt;)&lt;BR /&gt;, RangeSum ( Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'cost'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl*-1/1000000)&lt;BR /&gt;, Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'earning'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl/1000000))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;) / NoOfRows (total) /* NoOfRows (total) */&lt;BR /&gt;, rgb(255,255,255)&lt;BR /&gt;, rgb(255,73,99)&lt;BR /&gt;)&lt;BR /&gt;, ColorMix1 ( Rank ( total if ( not ( ( Isnull(LVL6) and dimensionality()=6 ) or&lt;BR /&gt;( Isnull(LVL5) and dimensionality()=5 ) or&lt;BR /&gt;( Isnull(LVL4) and dimensionality()=4 ) or&lt;BR /&gt;( Isnull(LVL3) and dimensionality()=3 ) or&lt;BR /&gt;( Isnull(LVL2) and dimensionality()=2 ) or &lt;BR /&gt;( Isnull(LVL1) and dimensionality()=1 )&amp;nbsp;&amp;nbsp;&lt;BR /&gt;)&lt;BR /&gt;, RangeSum ( Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'cost'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl*-1/1000000)&lt;BR /&gt;, Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'earning'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl/1000000))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;) / NoOfRows (total)&lt;BR /&gt;, rgb(5,206,159)&lt;BR /&gt;, rgb(218,254,245)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can anyone help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and Best&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Oct 2022 07:41:22 GMT</pubDate>
    <dc:creator>Costa</dc:creator>
    <dc:date>2022-10-17T07:41:22Z</dc:date>
    <item>
      <title>Dynamic coloring in pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-coloring-in-pivot-table/m-p/1993139#M82186</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;I have coloring problem and I hope someone can find the problem.&lt;/P&gt;
&lt;P&gt;What i want to achieve is, that positive value are colored, based on their rank from a light green to a dark green, while negative figures are colored from a light red to a dark red, based on their rank (zero = white).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Costa_1-1665992383525.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91414iF9DBCED392EA6D82/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Costa_1-1665992383525.png" alt="Costa_1-1665992383525.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, this pivot table is based on an unbalanced hierarchy. In order to prevent collapsing levels that are empty, I needed to bring in some logics.&lt;/P&gt;
&lt;P&gt;I took the same calculation logic into the colormix1 (rank..)) function for the background coloring.&lt;/P&gt;
&lt;P&gt;Unfortunatly it does not really work. Negative values are red and positives green, but there is no real color grading.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the following coding - ich believe the problem roots from the 'noofrows(total)', but i can't fix it:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If ( LVL1='Market Performance' and Dimensionality()='1' or&lt;BR /&gt;LVL1='Profit contribution' and Dimensionality()='1'or&lt;BR /&gt;LVL1='Operative Income I' and Dimensionality()='1'or&lt;BR /&gt;LVL1='Operative Income II'and Dimensionality()='1' or&lt;BR /&gt;LVL1='Operative Income III' and Dimensionality()='1'or&lt;BR /&gt;LVL1='Operative Income IV'and Dimensionality()='1'&lt;BR /&gt;, rgb(0,37,62)&lt;BR /&gt;, if ( if ( not ( ( Isnull(LVL6) and dimensionality()=6 ) or&lt;BR /&gt;( Isnull(LVL5) and dimensionality()=5 ) or&lt;BR /&gt;( Isnull(LVL4) and dimensionality()=4 ) or&lt;BR /&gt;( Isnull(LVL3) and dimensionality()=3 ) or&lt;BR /&gt;( Isnull(LVL2) and dimensionality()=2 ) or &lt;BR /&gt;( Isnull(LVL1) and dimensionality()=1 )&amp;nbsp;&amp;nbsp;&lt;BR /&gt;)&lt;BR /&gt;, RangeSum ( Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'cost'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl*-1/1000000)&lt;BR /&gt;, Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'earning'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl/1000000))&lt;BR /&gt;&lt;BR /&gt;) &amp;lt;= 0&lt;BR /&gt;, ColorMix1 ( Rank ( total if ( not ( ( Isnull(LVL6) and dimensionality()=6 ) or&lt;BR /&gt;( Isnull(LVL5) and dimensionality()=5 ) or&lt;BR /&gt;( Isnull(LVL4) and dimensionality()=4 ) or&lt;BR /&gt;( Isnull(LVL3) and dimensionality()=3 ) or&lt;BR /&gt;( Isnull(LVL2) and dimensionality()=2 ) or &lt;BR /&gt;( Isnull(LVL1) and dimensionality()=1 )&amp;nbsp;&amp;nbsp;&lt;BR /&gt;)&lt;BR /&gt;, RangeSum ( Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'cost'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl*-1/1000000)&lt;BR /&gt;, Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'earning'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl/1000000))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;) / NoOfRows (total) /* NoOfRows (total) */&lt;BR /&gt;, rgb(255,255,255)&lt;BR /&gt;, rgb(255,73,99)&lt;BR /&gt;)&lt;BR /&gt;, ColorMix1 ( Rank ( total if ( not ( ( Isnull(LVL6) and dimensionality()=6 ) or&lt;BR /&gt;( Isnull(LVL5) and dimensionality()=5 ) or&lt;BR /&gt;( Isnull(LVL4) and dimensionality()=4 ) or&lt;BR /&gt;( Isnull(LVL3) and dimensionality()=3 ) or&lt;BR /&gt;( Isnull(LVL2) and dimensionality()=2 ) or &lt;BR /&gt;( Isnull(LVL1) and dimensionality()=1 )&amp;nbsp;&amp;nbsp;&lt;BR /&gt;)&lt;BR /&gt;, RangeSum ( Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'cost'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl*-1/1000000)&lt;BR /&gt;, Sum({$&amp;lt;Table_ID={'PnL_internal'},PnL_Class={'earning'},$(vFY_BU_Flow_CurrentYear_Expression_vCurrency2)&amp;gt;}Kennzahl/1000000))&lt;BR /&gt;&lt;BR /&gt;)&lt;BR /&gt;) / NoOfRows (total)&lt;BR /&gt;, rgb(5,206,159)&lt;BR /&gt;, rgb(218,254,245)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can anyone help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and Best&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 07:41:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-coloring-in-pivot-table/m-p/1993139#M82186</guid>
      <dc:creator>Costa</dc:creator>
      <dc:date>2022-10-17T07:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic coloring in pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Dynamic-coloring-in-pivot-table/m-p/1993143#M82187</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Costa_0-1665992523635.png" style="width: 499px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/91416i32D8D3E2BA08543E/image-dimensions/499x313?v=v2" width="499" height="313" role="button" title="Costa_0-1665992523635.png" alt="Costa_0-1665992523635.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;probably easier to read &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 07:42:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Dynamic-coloring-in-pivot-table/m-p/1993143#M82187</guid>
      <dc:creator>Costa</dc:creator>
      <dc:date>2022-10-17T07:42:25Z</dc:date>
    </item>
  </channel>
</rss>

