<?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: Highlight measure values comparing across dimension value in Pivot table in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470694#M99647</link>
    <description>&lt;P&gt;So this will depend on how the "Quotedetails" dimension is ordered in the Pivot Table. If there is no ordering, the column background color expression can be modified to:&lt;/P&gt;
&lt;PRE&gt;if([QuoteDetails]&amp;lt;&amp;gt;'$(=FirstSortedValue(ALL QuoteDetails, ID))',&lt;BR /&gt;if(Sum(Amount) &amp;lt;&amp;gt; Sum({&amp;lt;[QuoteDetails]={"$(=FirstSortedValue(ALL QuoteDetails, ID))"}&amp;gt;} TOTAL&amp;lt;TierName, Country&amp;gt; Amount), Red()))&lt;/PRE&gt;
&lt;P&gt;If it is in ascending or descending alphabetical order, instead of FirstSortedValue, the MinString and MaxString functions must be used. I included the &lt;STRONG&gt;ID&lt;/STRONG&gt; parameter in the spreadsheet load, but it is just a call to the &lt;EM&gt;RowNo()&lt;/EM&gt; function.&lt;/P&gt;
&lt;P&gt;Doing it this way, the SetAnalysis expression will always compare the current QuoteDetails value with the value of the &lt;STRONG&gt;first column of the table&lt;/STRONG&gt; (which is what I understood to be the requirement of this problem).&lt;/P&gt;
&lt;P&gt;As for the background colors of each Quote, I would suggest creating a variable or a table for this, avoiding more complex logic. In the case of a table, it would look like this:&lt;/P&gt;
&lt;P&gt;In the load script:&lt;/P&gt;
&lt;PRE&gt;QuoteColors:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;QuoteDetails, QuoteColor&lt;BR /&gt;Quote1, #FF8080&lt;BR /&gt;Quote2, #80FF80&lt;BR /&gt;];&lt;/PRE&gt;
&lt;P&gt;In the table:&lt;/P&gt;
&lt;PRE&gt;if([QuoteDetails]&amp;lt;&amp;gt;'$(=FirstSortedValue(ALL QuoteDetails, ID))',&lt;BR /&gt;if(Sum(Amount) &amp;lt;&amp;gt; Sum({&amp;lt;[QuoteDetails]={"$(=FirstSortedValue(ALL QuoteDetails, ID))"}&amp;gt;} TOTAL&amp;lt;TierName, Country&amp;gt; Amount), Only(QuoteColor)))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Jul 2024 12:32:45 GMT</pubDate>
    <dc:creator>rodrigo_martins</dc:creator>
    <dc:date>2024-07-15T12:32:45Z</dc:date>
    <item>
      <title>Highlight measure values comparing across dimension value in Pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470325#M99609</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;We have a requirement wherein we need to compare the expression values and color the same.&lt;/P&gt;
&lt;P&gt;For Eg. Below data set has 5 dimension and 1 measure calculated in a native pivot table. Out of 5 dim, 2 of them are added in rows and other 3 in the columns. We need to compare Quote1, Quote 2 expression value with Quote (Existing) dimension. If there is a difference in the value, that cell needs to be highlighted and if the value is same then no color highlighting is required.&lt;/P&gt;
&lt;P&gt;I have attached sample data from which below pivot has been generated. Kindly assist.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sumeetvaidya1_1-1720786111417.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169304i106CD714C0D373FB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sumeetvaidya1_1-1720786111417.png" alt="sumeetvaidya1_1-1720786111417.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sumeet&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 20:55:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470325#M99609</guid>
      <dc:creator>sumeet-vaidya1</dc:creator>
      <dc:date>2024-11-15T20:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight measure values comparing across dimension value in Pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470349#M99614</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Put this expression as the background color of your measure:&lt;/P&gt;
&lt;PRE&gt;if([QuoteDetails]&amp;lt;&amp;gt;'Quote (Existing)', //1st columns (Quote Existing) ignored (mantain white)&lt;BR /&gt;if(Sum(Amount) &amp;lt;&amp;gt; Sum({&amp;lt;[QuoteDetails]={'Quote (Exisiting)'}&amp;gt;} TOTAL&amp;lt;TierName, Country&amp;gt; Amount), //compare current Amount with first columns (Quote Existing) Amount&lt;BR /&gt;if([QuoteDetails]='Quote1', Red(), if([QuoteDetails]='Quote2', Blue())))) //if equals, paint Red column Tier1 and Blue column Tier2&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rodrigo_martins_0-1720790042692.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/169307i316371DC7F5CD322/image-size/large?v=v2&amp;amp;px=999" role="button" title="rodrigo_martins_0-1720790042692.png" alt="rodrigo_martins_0-1720790042692.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You can replace the color functions (Red(), Blue()) with hexadecimal codes ('#80FFFF', '#FFFF80').&lt;BR /&gt;For more information about the how the TOTAL modifier works, I recommend this post &lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Keywords-TOTAL-ALL-DISTINCT/td-p/143514" target="_blank" rel="noopener"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 13:15:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470349#M99614</guid>
      <dc:creator>rodrigo_martins</dc:creator>
      <dc:date>2024-07-12T13:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight measure values comparing across dimension value in Pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470574#M99636</link>
      <description>&lt;P&gt;Hi Martin,&lt;/P&gt;
&lt;P&gt;Thank you for your response...!!!&lt;/P&gt;
&lt;P&gt;Values in "Quotedetails" column will be dynamic so we wont be able to hard code any dimension values.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 06:52:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470574#M99636</guid>
      <dc:creator>sumeet-vaidya1</dc:creator>
      <dc:date>2024-07-15T06:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Highlight measure values comparing across dimension value in Pivot table</title>
      <link>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470694#M99647</link>
      <description>&lt;P&gt;So this will depend on how the "Quotedetails" dimension is ordered in the Pivot Table. If there is no ordering, the column background color expression can be modified to:&lt;/P&gt;
&lt;PRE&gt;if([QuoteDetails]&amp;lt;&amp;gt;'$(=FirstSortedValue(ALL QuoteDetails, ID))',&lt;BR /&gt;if(Sum(Amount) &amp;lt;&amp;gt; Sum({&amp;lt;[QuoteDetails]={"$(=FirstSortedValue(ALL QuoteDetails, ID))"}&amp;gt;} TOTAL&amp;lt;TierName, Country&amp;gt; Amount), Red()))&lt;/PRE&gt;
&lt;P&gt;If it is in ascending or descending alphabetical order, instead of FirstSortedValue, the MinString and MaxString functions must be used. I included the &lt;STRONG&gt;ID&lt;/STRONG&gt; parameter in the spreadsheet load, but it is just a call to the &lt;EM&gt;RowNo()&lt;/EM&gt; function.&lt;/P&gt;
&lt;P&gt;Doing it this way, the SetAnalysis expression will always compare the current QuoteDetails value with the value of the &lt;STRONG&gt;first column of the table&lt;/STRONG&gt; (which is what I understood to be the requirement of this problem).&lt;/P&gt;
&lt;P&gt;As for the background colors of each Quote, I would suggest creating a variable or a table for this, avoiding more complex logic. In the case of a table, it would look like this:&lt;/P&gt;
&lt;P&gt;In the load script:&lt;/P&gt;
&lt;PRE&gt;QuoteColors:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;QuoteDetails, QuoteColor&lt;BR /&gt;Quote1, #FF8080&lt;BR /&gt;Quote2, #80FF80&lt;BR /&gt;];&lt;/PRE&gt;
&lt;P&gt;In the table:&lt;/P&gt;
&lt;PRE&gt;if([QuoteDetails]&amp;lt;&amp;gt;'$(=FirstSortedValue(ALL QuoteDetails, ID))',&lt;BR /&gt;if(Sum(Amount) &amp;lt;&amp;gt; Sum({&amp;lt;[QuoteDetails]={"$(=FirstSortedValue(ALL QuoteDetails, ID))"}&amp;gt;} TOTAL&amp;lt;TierName, Country&amp;gt; Amount), Only(QuoteColor)))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jul 2024 12:32:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Highlight-measure-values-comparing-across-dimension-value-in/m-p/2470694#M99647</guid>
      <dc:creator>rodrigo_martins</dc:creator>
      <dc:date>2024-07-15T12:32:45Z</dc:date>
    </item>
  </channel>
</rss>

