<?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: Different color for each subtotal-line in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131457#M509980</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as your dimension-values are always sorted in the same way you could try it with dual-values of them like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dual(FIELD, autonumber(FIELD)) as FIELD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It just required that you order the fieldvalues in the wanted way. An alternatively to the autonumber() might be a pick(match()) or an applymap() matching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your pivot is dynamic in any way the above method won't work. In this case you need to rank your dimension-values in some way - either per an applied numeric sorting or with a ranking on the dimension-values itself. Here an example in which direction it might go:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(NODISTINCT num(rank(total MaxString([FIELD]), 1)), [FIELD]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this could be wrapped with a pick(match()) to assign the colors to the rank-position (this also menat for the dual-example from above). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside this are you sure that you really want to make the table so colorful? IMO it doesn't help the readability of the content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Oct 2018 13:13:49 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2018-10-04T13:13:49Z</dc:date>
    <item>
      <title>Different color for each subtotal-line</title>
      <link>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131456#M509979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a table, currently looking like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/215013_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;I managed to get the 1st Total-line 'isolated' using rowno() so I can give it a separate color (choose yellow now to make it stand out).&lt;/P&gt;&lt;P&gt;I managed to get the 3rd Total-line 'isolated' using Dimensionality() so I can do the same (choose green to match the dimension)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, how do I 'isolate' the 2nd Total-line? I only managed to 'isolate' the entire block using a combination of both Dimensionality() and rowno(), but I can't seem to 'isolate' the Total-line so I can color it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want, is that only the Total-line gets the red color, the other two lines should become white.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The formula used on the 3 expression-columns for the color is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(rowno()=0,yellow(),if(Dimensionality()=0,green(),if(Dimensionality()=1,if(isnull(rowno()),red(),white()),white())))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any suggestions!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2018 12:33:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131456#M509979</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-03T12:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Different color for each subtotal-line</title>
      <link>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131457#M509980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as your dimension-values are always sorted in the same way you could try it with dual-values of them like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dual(FIELD, autonumber(FIELD)) as FIELD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It just required that you order the fieldvalues in the wanted way. An alternatively to the autonumber() might be a pick(match()) or an applymap() matching.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your pivot is dynamic in any way the above method won't work. In this case you need to rank your dimension-values in some way - either per an applied numeric sorting or with a ranking on the dimension-values itself. Here an example in which direction it might go:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg(aggr(NODISTINCT num(rank(total MaxString([FIELD]), 1)), [FIELD]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this could be wrapped with a pick(match()) to assign the colors to the rank-position (this also menat for the dual-example from above). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beside this are you sure that you really want to make the table so colorful? IMO it doesn't help the readability of the content.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2018 13:13:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131457#M509980</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-10-04T13:13:49Z</dc:date>
    </item>
    <item>
      <title>Re: Different color for each subtotal-line</title>
      <link>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131458#M509981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You should be able to achieve this with Dimensionality() and Background Color&lt;/P&gt;&lt;P&gt;I added was the following code to all the Dimensions and Expressions (by clicking on the little plus sign next to the field name) then under the Background Color option:&lt;/P&gt;&lt;P&gt;=if(Dimensionality() = 0, yellow(200),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Dimensionality() = 1, blue(100),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Dimensionality() = 2, green(200),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; white()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;You can select any color you want via the rgb(?,?,?) options too.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Pivot Table Total Colouring.png" class="jive-image image-1" src="/legacyfs/online/216219_Pivot Table Total Colouring.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2018 11:23:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131458#M509981</guid>
      <dc:creator>njmaehler</dc:creator>
      <dc:date>2018-10-18T11:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Different color for each subtotal-line</title>
      <link>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131459#M509983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.qlik.com/qlik-users/27943"&gt;marcus_sommer&lt;/A&gt;, the dual-function in the script worked like a charm, since my Dimension order is always the same indeed. I agree on the 'so colorful' remark by the way, only made the colors stand out in my example to clarify things - see the image below for the end-result &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Might anyone else need this in the future, here's what I did: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I added &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;dual([Feed Regions Total],AutoNumber([Feed Regions Total])) as DUALFIELD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to my script and used that to create the following Background Color Formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=if(rowno()=0,green(),if(Dimensionality()=0,green(),if(Dimensionality()=1,if(DUALFIELD='Derden',green(),white()),white())))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gave me this as end-result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/216434_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another image, showing the values for Dimensionality(), rowno() and DUALFIELD which helped create the color-formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/216435_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Oct 2018 09:34:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Different-color-for-each-subtotal-line/m-p/131459#M509983</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-10-22T09:34:53Z</dc:date>
    </item>
  </channel>
</rss>

