Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting a column total in a pivot table

KindInv NameCreatedSold% Sold
Grantpart15240%
part22150%
Total 7343%

I know I've seen this before but I'm struggling to find it.  Is it possible to get the column total and use it in an expression to set a background color.

I've done this in the past but I had to recreate the expression.  This is a very simple example, my actual example is much more difficult.

What I want to do is use the number 7 (total for created) in the Background Color for % Sold.  So, for example, I'll color 40% red since it's under the %Sold Total of 43%.

Can I somehow just get the column(1) total somehow? 

3 Replies
shree909
Partner - Specialist II
Partner - Specialist II

Hi on the % told  KPI go to the background and write an if statement

if( %sold <'40 %' red(), green())

hope this helps .if not  attach an qvw file

bgerchikov
Partner - Creator III
Partner - Creator III

Shree,

your expression will change backgroung for the entire entire column. To have background color for the total line you should add dimensionality:

if(dimensionality()=0 and %sold <'40 %' red(), green())

whiteline
Master II
Master II

Expand the %Sold expression in the chart properties.

For Backgroud Color use something like this

=if([%sold expression] <  [%sold expression with total], lightred(), lightgreen())

[%sold expression] - is your expression for  %Sold

[%sold expression with total] - is your expression for  %Sold with total modifier.

for example: Sum(value), Sum(total value) - with total modifier.