Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I am trying to create a condition which alternate the color background, depending the value of the field.
Basically, the background should be RED if the value is negative (< 0), and should be GREEN if the value is positive (> 0).
Suposing that my field is "balance", i tryed to use the following expression:
if([Balance] > 0, Green(), Red())
But my chart is displaying always the Red Color, even if the value of Balance is positive.
Someone could help to fix that?
Regards,
May be there are more than one Balance for each row? May be try Sum([Balance]) or Avg([Balance]) or some other aggregation in your expression?
If(Sum([Balance]) > 0, Green(), Red())
May be there are more than one Balance for each row? May be try Sum([Balance]) or Avg([Balance]) or some other aggregation in your expression?
If(Sum([Balance]) > 0, Green(), Red())
Everything looks OK to me,
Let me ask you this
Hope you are writing the above mentioned expression in Expressions Tab?
It doesn't even matter where you are writing.
It would be great if u can share a sample app..
Do you have a column with the same name of your field? Maybe this is a problem.
I hae many values in the field Balance, i am doing sum of all the values of this column:
Sum(Balance)
Hi there.
As a rule of thumb you should always use aggregation functions instead of field references in chart expressions:
Kind regards,
Ernesto.
Thanks Sunny,
It was missing the sum statement, now it is ok!
Awesome