<?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: Pivot - background color based on other rows result in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034464#M15992</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this a pivot table with three dimensions and 1 expression or straight table with 2 dimensions and 2 expressions. If its a straight table, try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(article = 'art 2', If(Sum([Sales]) &amp;lt; Sum({&amp;lt;article= &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;{&lt;/SPAN&gt;'art 1'&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;}&lt;/SPAN&gt;&amp;gt;} &lt;SPAN style="color: #ff0000;"&gt;TOTAL &amp;lt;customer&amp;gt;&lt;/SPAN&gt; [Sales]), red()))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Apr 2016 16:42:16 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-04-14T16:42:16Z</dc:date>
    <item>
      <title>Pivot - background color based on other rows result</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034460#M15988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to change the background color of some cells inside a pivot, based on the measure result in another row. So lets say I have the following pivot table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;customer&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;article&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Jan&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Feb&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;cust A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;art 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;500&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;art 2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;cust B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;art 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;art 2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;600&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;700&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... I would have the following result:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;}" style="border: 1px solid #000000; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;customer&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;article&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Jan&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Feb&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;cust A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;art 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;500&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;art 2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px; background-color: #ff0000;"&gt;500&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;cust B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;art 1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;art 2&lt;/TD&gt;&lt;TD style="padding: 2px; background-color: #ff0000;"&gt;600&lt;/TD&gt;&lt;TD style="padding: 2px; background-color: #ff0000;"&gt;700&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the bg color expression should be something like&lt;/P&gt;&lt;P&gt;If(article = 'art 2', If(Sum([Sales]) &amp;lt; Sum({&amp;lt;article='art 1'&amp;gt;} Total [Sales]), red()))&lt;/P&gt;&lt;P&gt;... which does not work &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone has an idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Christof&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:04:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034460#M15988</guid>
      <dc:creator />
      <dc:date>2016-04-14T16:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot - background color based on other rows result</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034461#M15989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You missed the curly brackets, may be this:&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: 13px;"&gt;&lt;STRONG&gt;If(article = 'art 2', If(Sum([Sales]) &amp;lt; Sum({&amp;lt;article= &lt;SPAN style="color: #ff0000;"&gt;{&lt;/SPAN&gt;'art 1'&lt;SPAN style="color: #ff0000;"&gt;}&lt;/SPAN&gt;&amp;gt;} Total [Sales]), red()))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:09:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034461#M15989</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-14T16:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot - background color based on other rows result</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034462#M15990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think, based on the colors I am seeing, you might need this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(article = 'art 2', If(Sum([Sales]) &amp;lt; Sum({&amp;lt;article= &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;{&lt;/SPAN&gt;'art 1'&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;}&lt;/SPAN&gt;&amp;gt;} [Sales]), red()))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:11:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034462#M15990</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-14T16:11:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot - background color based on other rows result</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034463#M15991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right, the missing curly brackets were just a typo in my post ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sadly this formula, also without the "Total", does not work ... It seems like it simply ingores the set analysis if I drop the "Total". Based on some test I did, I guess that the result for &lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Sum({&amp;lt;article= &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;{&lt;/SPAN&gt;'art 1'&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;}&lt;/SPAN&gt;&amp;gt;} [Sales]) &lt;/STRONG&gt;is always 0.&lt;/P&gt;&lt;P&gt;If I include the "Total" it ignores the columns and rows value &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any other idea? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:23:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034463#M15991</guid>
      <dc:creator />
      <dc:date>2016-04-14T16:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot - background color based on other rows result</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034464#M15992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this a pivot table with three dimensions and 1 expression or straight table with 2 dimensions and 2 expressions. If its a straight table, try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(article = 'art 2', If(Sum([Sales]) &amp;lt; Sum({&amp;lt;article= &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;{&lt;/SPAN&gt;'art 1'&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;}&lt;/SPAN&gt;&amp;gt;} &lt;SPAN style="color: #ff0000;"&gt;TOTAL &amp;lt;customer&amp;gt;&lt;/SPAN&gt; [Sales]), red()))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:42:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034464#M15992</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-04-14T16:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot - background color based on other rows result</title>
      <link>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034465#M15993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yesss.. you're the man! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt; ... that did the trick &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the pivot table does have a lot of rows and only one column (month). so i did just include all the rows and the column inside &amp;lt;&amp;gt; after total (but without &lt;STRONG&gt;article&lt;/STRONG&gt;), which then worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(article = 'art 2', If(Sum([Sales]) &amp;lt; Sum({&amp;lt;article= &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;{&lt;/SPAN&gt;'art 1'&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;}&lt;/SPAN&gt;&amp;gt;} &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;TOTAL &amp;lt;month,customer,and,all,other,rows,except,article&amp;gt;&lt;/SPAN&gt; [Sales]), red())) &lt;/STRONG&gt;... did the job for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perfect, thank you very much! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:54:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Pivot-background-color-based-on-other-rows-result/m-p/1034465#M15993</guid>
      <dc:creator />
      <dc:date>2016-04-14T16:54:58Z</dc:date>
    </item>
  </channel>
</rss>

