Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Text color of calculated dimension

Hi all,

I would like to change the text color of a value in a calculated dimension. The color change should be related to the dimension value and a variable. The variable could be changed by user by a input field. I tried the following in my expression for text color of the calculated dimension

=if(num(sum(SalesAmount),'0,00') < v_Factor, RGB(100,0,0), RGB(0,200,0) )

In this case my variable has the value 1.

I do not understand the logic of qlikview, because some values greater than 1 are green, but some values less than 1 are green, too. And no value is red.

Thanks a lot!

5 Replies
MayilVahanan

HI

Can you provide a sample file? Its useful for analysis the problem more detail

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Anonymous
Not applicable
Author

Hi,

I built a simple example. The condition for text color does not work and my variable has no effect.

Thank you very much!

Sort.qvw

jonathandienst
Partner - Champion III
Partner - Champion III

Stephen

The problem with using a calculated dimension is that the Aggr() expressions need to include all the chart dimensions, which is not possible with a calculated dimension. Your logic works correctly, but only for the first row - because the colour expression is missing the calculated dimension. If you select a value less than 85, the first row goes green as expected, but the colur expression is not computed for the other rows.

I have attached a version which uses a calculated total and only the two dimensions Customer and Month. This works correctly.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi Jonathan,

thanks al lot! Your example works fine, but I made a mistake in my example QVW.

My QVW represented not the complete problem. I need to tell you why I use a calculated dimension. I use a calculated dimension because I need the result only one time. When I replace my calculated dimension with a normal expression, the I have the value in every column for every month. The result I need is to get only one column at the beginning of my pivot table. I hope you understand what I mean.

I refreshed my example file.

So, my conculsion is, that is not possible to get both. A measure only shown as total and the value with different colors. Is this correct?

Thanks

Sort3.qvw

jonathandienst
Partner - Champion III
Partner - Champion III

Stephen

You could try the same approach I used, but modify the expression so that it returns nothing when the SecondaryDimensionality <> 0. So the chart expression becomes:

=If(SecondaryDimensionality() > 0, 0, Avg(Aggr(Sum(Amount), Customer, Month)))

With the same colour expression as before

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein