Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like some help in formulating a text colour expression.
I want the text to be green when the variance ([Project Year Budget]) - sum([Project Expenditure Amount]) is less than the budget. But I also want the text to be red when the variance falls below zero. And, yellow when the variance is equal to the budget.
I have tried to do so using this expression:
if((sum([Project Year Budget]) - sum([Project Expenditure Amount])) < sum([Project Year Budget]), green (255)
,if((sum([Project Year Budget]) - sum([Project Expenditure Amount])) <'-1', red ()
,if((sum([Project Year Budget]) - sum([Project Expenditure Amount])) = sum([Project Year Budget]), RGB(255,128,0)
)))
The yellow and green text is working correctly. But I cannot work out how to get variance below zero to turn red. I imagine it is because a value below zero is also less than the project year budget and thus it turns green as it is commanded to do in the first line of the expression.
How would I get it to work?
Thank you in advance
IF( Sum([Project Expenditure Amount]) > Sum([Project Year Budget]) , RED(),
IF( Sum([Project Expenditure Amount]) < Sum([Project Year Budget]) , GREEN(),YELLOW()
))
the way you wrote the green condition won't this always be true assuming there is any spend?
sum([Project Year Budget]) - sum([Project Expenditure Amount]) < sum([Project Year Budget])
Can you elaborate on which results are not working?
It will evaluate in order of the IF statement. So make the first check be the condition for RED, if that is met then all other conditions will not be checked. The move on from there with the second check.
Hi Dan,
Thanks for your response.
Do you mean like this?
if((sum([Project Year Budget]) - sum([Project Expenditure Amount])) <0, red (255)
,if((sum([Project Year Budget]) - sum([Project Expenditure Amount])) < sum([Project Year Budget]), green (255)
,if((sum([Project Year Budget]) - sum([Project Expenditure Amount])) = sum([Project Year Budget]), RGB(255,128,0)
)))
If so, unfortunately that doesn't work.
IF( Sum([Project Expenditure Amount]) > Sum([Project Year Budget]) , RED(),
IF( Sum([Project Expenditure Amount]) < Sum([Project Year Budget]) , GREEN(),YELLOW()
))
the way you wrote the green condition won't this always be true assuming there is any spend?
sum([Project Year Budget]) - sum([Project Expenditure Amount]) < sum([Project Year Budget])
Can you elaborate on which results are not working?
Hi,
I have tried that but unfortunately it isn't working.
Using the expression in my initial post, it is only making the negative values red that is not working.
not sure why it isn't working. can you post some data or a sample qvf to work from?
Hi Dan,
As I cannot share the data with you, I was just making a test app to send to you but your expression worked for it. Strange! I am unsure what is causing the issue on my end in that case. But, thank you, your expression works.