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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Color de texto variable / Font color according to variables

Buenas tardes / Good afternoon

Hola, tengo una tabla simple cuyos valores de dimension son una lista de valores:

=ValueList('1 VENTA TOTAL','2 DEVOLUCION','VENTA NETA COMERCIAL','3 RECUPERACION','4 BONIFICACION',.....

Y despues las expresiones estan caluladas por "Pick"

Pick(

  Match(ValueList('1 VENTA TOTAL','2 DEVOLUCION','VENTA NETA COMERCIAL',

//VENTA TOTAL

Sum({$<AÑO={"Real-2011"}>}[1 VENTA TOTAL]),

//DEVOLUCION

Sum({$<AÑO={"Real-2011"}>}[2 DEVOLUCION]),

//VENTA NETA COMERCIAL

Sum({$<AÑO={"Real-2011"}>}[3 VENTA NETA COMERCIAL]),

....

De estos rubros tengo datos del 2012 y comparo contra el 2011 y contra un Presupuesto, y quisiera colocar algun color a dichas sumas dependiendo si estan por encima o por debajo del presupuesto o el 2011, en excel esto seria facil con un formato condicional. ¿Como puedo lograr esto en el codigo?.

Gracias.

Saludos.

--------------------------------------------------------------------------------------------

Hi, I have a simple table with a valuelist as dimensions field

  --- See first code---

And after that, the expresions are calculated by a "Pick" sentence

  --- See second code--

I have 2012 data and evaluate this fields against 2011 and a budget, and i wanto to put some color according theyr performance against 2011 or the budget, in excel a simple conditiona format would solve this issue. ¿How I could solve this in the code?

Thanks

5 Replies
Not applicable
Author

You can write an expression to format however you'd like under Chart Properties > Expressions > Click on plus sign:

Capture.JPG

Not applicable
Author

Hi, thx for the fast answer.

  The issue by doing it that way its that I have diferent chriteria for each value, let me set a small example:

Field      | Real 2012  |   Budget   | 2012 vs Budget

Sales     | $     900      |    $1,000   |     111%  (Green, we sell more than spected)

Costs     | $     500      |    $  600    |     120%   (Red, it cost more than spected)

In the first case, beeing above 100% goes green, but in the second case goes red.

Hope this helps to clarify

Thanks

MayilVahanan

HI

try like this

=if(sum(sales)/sum(total sales) > 100%, green(),red()) in background color//

in this,instead of the above expression, use yours..

Hope it helps.. or post a sample file

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

Here is a sample file of using colors based on an expression.

Not applicable
Author

Hi, thank you both for the answers, I finally solved out, with a little of both, I ended copying the way I calculate the expression and adding there the conditions for colors the way I needed

Thank you again