Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following If which is setting the background colour in my straight table.
IF(FORECAST_STATUS='CONFIRMED FDD',rgb(200,240,200),
IF(FORECAST_STATUS='UNCONFIRMED FDD',rgb(255,153,0),
IF(FORECAST_STATUS='NO FDD',rgb(255,80,80),'')))';
On its own it works fine but so that I don’t have to amend it 2 dozen times I assumed I could set it as a Variable and apply the variable to the background colour instead.
The set variable is scripted as follows in the first tab:
SET vFDDSTATUS = '=IF(FORECAST_STATUS='CONFIRMED FDD',rgb(200,240,200),
IF(FORECAST_STATUS='UNCONFIRMED FDD',rgb(255,153,0),
IF(FORECAST_STATUS='NO FDD',rgb(255,80,80),'')))';
My main concern is that FORECAST_STATUS doesn’t exist this early………………or is that not a concern when setting variable?
Thank You
worked it out:
SET vFDDSTATUS = IF(FORECAST_STATUS='CONFIRMED FDD',rgb(200,240,200),
IF(FORECAST_STATUS='UNCONFIRMED FDD',rgb(255,153,0),
IF(FORECAST_STATUS='NO FDD',rgb(255,80,80),'')));
then use variable as such:
=$(vFDDSTATUS)
It should not be a problem if FORECAST_STATUS doesn't exists. What might be a concern is that fact that you have single quote within the single quote here. Not sure how it will behave, but give it a shot and see what happens?
Afternoon,
oh it definitely doesn't work but I am not getting a failure and the variable is being created.
Like I say, using the statement on it own in the Background Colour setting works fine.
Do you see the variable in the variable overview? How does it look within the variable overview?
admittedly in the overviewer the first and last '' exist so it may be that..............
Then try it like this and see what happens
SET vFDDSTATUS = =IF(FORECAST_STATUS='CONFIRMED FDD',rgb(200,240,200),
IF(FORECAST_STATUS='UNCONFIRMED FDD',rgb(255,153,0),
IF(FORECAST_STATUS='NO FDD',rgb(255,80,80),'')));
or
SET vFDDSTATUS = IF(FORECAST_STATUS='CONFIRMED FDD',rgb(200,240,200),
IF(FORECAST_STATUS='UNCONFIRMED FDD',rgb(255,153,0),
IF(FORECAST_STATUS='NO FDD',rgb(255,80,80),'')));
Notice that the second expression doesn't have an equal sign
worked it out:
SET vFDDSTATUS = IF(FORECAST_STATUS='CONFIRMED FDD',rgb(200,240,200),
IF(FORECAST_STATUS='UNCONFIRMED FDD',rgb(255,153,0),
IF(FORECAST_STATUS='NO FDD',rgb(255,80,80),'')));
then use variable as such:
=$(vFDDSTATUS)