<?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 Color background color based on column partial sum in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261707#M495728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using pivot tables, how do I do the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image" src="https://community.qlik.com/legacyfs/online/11067_Capture.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I want to color code the row depending on how it's % Sold is doing compared to the total average (partial sum)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, for example, Cat Treat and Pig Leash have only sold 20% and 2% respectively while the overall average is 50% for all products, so it gets red.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I know I need something like this for my background colors........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(total for column 3 &amp;gt;= column 3 for item, RED, BLUE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Feb 2012 23:30:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-07T23:30:38Z</dc:date>
    <item>
      <title>Color background color based on column partial sum</title>
      <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261707#M495728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using pivot tables, how do I do the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image" src="https://community.qlik.com/legacyfs/online/11067_Capture.JPG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I want to color code the row depending on how it's % Sold is doing compared to the total average (partial sum)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, for example, Cat Treat and Pig Leash have only sold 20% and 2% respectively while the overall average is 50% for all products, so it gets red.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I know I need something like this for my background colors........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(total for column 3 &amp;gt;= column 3 for item, RED, BLUE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 23:30:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261707#M495728</guid>
      <dc:creator />
      <dc:date>2012-02-07T23:30:38Z</dc:date>
    </item>
    <item>
      <title>Color background color based on column partial sum</title>
      <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261708#M495729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if % Sold is maybe calculated like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(Sold) / sum(Available)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then your background color expression may look like&lt;/P&gt;&lt;P&gt;=if( sum(Sold) / sum(Available) &amp;gt;= sum(total Sold) / sum(total Available), red(), blue() )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 23:46:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261708#M495729</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-02-07T23:46:58Z</dc:date>
    </item>
    <item>
      <title>Color background color based on column partial sum</title>
      <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261709#M495730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kind of. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the defs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;column(1) = Available = sum(available_count)&lt;/P&gt;&lt;P&gt;column(2) = Sold = sum(sold_count)&lt;/P&gt;&lt;P&gt;column(3) = % Sold = column(2) / column(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I went into the background color and put this in but it's not working as expected.&amp;nbsp; It's all blue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(column(2)/column(1) &amp;gt;= sum(total column(2)) / sum(total column(1)), red(), blue())&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 14:51:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261709#M495730</guid>
      <dc:creator />
      <dc:date>2012-02-08T14:51:21Z</dc:date>
    </item>
    <item>
      <title>Color background color based on column partial sum</title>
      <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261710#M495731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think something like sum(total column(2) ) will not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;=if( sum(sold_count) / sum(available_count) &amp;gt;= sum(total sold_count)/sum(total available_count), red(), blue())&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 15:04:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261710#M495731</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-02-08T15:04:53Z</dc:date>
    </item>
    <item>
      <title>Color background color based on column partial sum</title>
      <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261711#M495732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you.&amp;nbsp; That works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can start another post but I just tried making the pivot table a little more multi-dimensional by adding Sale Year to it, so now it looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/11092_Capture.PNG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the formula above worked when it wasn't by year but now it appear the TOTAL portion of that expression totals all columns up?&amp;nbsp; So, since the overall percentage is 53% (131+61/260+100), Dog collar in 2011 is showing up RED since it's below 53% but really it should be blue because it's above 50% for that specific year.&amp;nbsp; Does that make sense?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to get the partial sum for the column instead of the total sum for all the columns?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 15:22:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261711#M495732</guid>
      <dc:creator />
      <dc:date>2012-02-08T15:22:51Z</dc:date>
    </item>
    <item>
      <title>Color background color based on column partial sum</title>
      <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261712#M495733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I figured it out.&amp;nbsp; Need to add the column you want to group by after the total, so this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if( sum(sold_count) / sum(available_count) &amp;gt;= sum(total &amp;lt;TheYear&amp;gt; sold_count)/sum(total &amp;lt;TheYear&amp;gt; available_count), red(), blue())&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 15:25:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261712#M495733</guid>
      <dc:creator />
      <dc:date>2012-02-08T15:25:40Z</dc:date>
    </item>
    <item>
      <title>Color background color based on column partial sum</title>
      <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261713#M495734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, should be correct. You can list the fields to ignore in the total, so you can still group by, using the &amp;lt;&amp;gt; syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 15:28:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/261713#M495734</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-02-08T15:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Color background color based on column partial sum</title>
      <link>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/1603754#M495735</link>
      <description>&lt;P&gt;Please help me out here...&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/New-to-QlikView/How-to-change-the-Background-color-of-Total-in-Pivot-table/m-p/1603729#M378137" target="_blank"&gt;https://community.qlik.com/t5/New-to-QlikView/How-to-change-the-Background-color-of-Total-in-Pivot-table/m-p/1603729#M378137&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Color-background-color-based-on-column-partial-sum/m-p/1603754#M495735</guid>
      <dc:creator>qlikviewforum</dc:creator>
      <dc:date>2019-07-18T14:20:04Z</dc:date>
    </item>
  </channel>
</rss>

