Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how to write in pivot table if sum(sales) > total sales then green() else red(). I wrote in background color section as if(sum(sales)<sum(total sales),red(),green()) but not getting correct result
Hi,@venky77777
You need to adjust your code for the total by its dimension, in your expression the sum takes the total regardless of the city category, for this you need to specify the dimension between <dimension>:
See if this is correct:
if(dimensionality()=1, if(sum(sales)<sum(total <city>sales),red(),green()))
Regarts, Matheus
@venky77777 What do you mean when you say that you are not getting correct results?
Maybe sum(sales) is equal to sum(total sales). So if you are swapping < and > to test, you may be getting the same result.
@venky77777 when posting be sure to specify what Qlik software you are using (and the version) we have multiple products so be sure to specify QlikView, QlikSense, Qlik Cloud, or NPrinting thanks!
yes i done, but the problem is getting color for totals and also getting all red or all green based <or>
sure. thanks for reply
Something like this to highlight totals?
Hi,
Try DIMENSIONALITY(). There's a help article with an example that will tell you everything about this function. This will allow you to define a different color scheme on different levels.
Does this help you with your question?
Dimensionality - chart function | Qlik Sense on Windows Help
With kind regards,
Sem
when i wrote in background color section if(dimensionality()=1, if(sum(sales)<sum(total sales),red(),green())), getting table as below but not getting green color
thanks for reply, i applied but I'm not getting 2 colors
send a screenshot of the result as well as the expression you used