Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
This is about colorcoding a simple table with If-clauses in the expression field of the background color and using variables to adapt the limits.
It did not work out and I wonder why?
As this works:
If( [Ratio] >= 0.1, LightBlue(),
If([Ratio] >= -0.1, Green(),
LightMagenta()))
this does not:
If(
[Ratio] >= Num($(vBlockCColorBound),'#,##',','), LightBlue(),
If([Ratio] >= Num($(vBlockCColorBoundLow),'#,##',','), Green(),
LightMagenta()))
with
vBlockCColorBound = 0,1
vBlockCColorBoundLow = -0,1
Seems that I always get a 0 as result of both Num().
[Ratio] is the label of the expression I want to colorcode.
Both valuables are in the end defined by users via sliders with German number conventions (DecimalSep=',') that should not be changed.
At first if you want to change the decimal-sign you need to apply the num-function with all 3 format-parameter. But the decimal-sign which you applied within the first parameter '#,##' isn't relevant because it will be changed with the second parameter which must be then '.'. If you used my suggestion from above:
= num(vTest, '#,##', '.', ',') // vTest: 0,1
it will work.
- Marcus
Marcus,
you are right, it works:
If( [Ratio] >= Num(vBlockCColorBound,'#,##','.',',') , LightBlue() ...
What also worked was Sébastien's proposal with a slight change:
If(
[Ratio] >= Num#('$(vBlockCColorBound)','#,##','.',',') ,
I also tested Sadi's proposal, but is sadly did not work well, even with some variations.
If(
Num([Ratio],'#,##',',') >= Num($(vBlockCColorBound),'#,##',',') ,
but is sadly did not work well, even with some variations.
Thank you all!