Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Greeting Qlik community,
I have a simple if statement that works. It's:
=if([ABS_TYPE]='Centers',rgb(642,67,67),if([ABS_TYPE]='Grant',rgb(25,58,223),if([ABS_TYPE]='Fellow',rgb(0,204,0),if([ABS_TYPE]='SBIR',rgb(255,37,249)))))
What I want to do is add another if that, if the grant is a STAR grant, then the color of the point is Yellow. I tried this:
=if([ABS_TYPE]='Centers',rgb(642,67,67),if([ABS_TYPE]='Grant',rgb(25,58,223),if([ABS_TYPE]='Fellow',rgb(0,204,0),if([ABS_TYPE]='SBIR',rgb(255,37,249))))
if([STAR]='Y',rgb(255,255,51)))
I get the error that ) is expected. I know I have to put a comma between the two ifs, but not exaclty sure where it goes as when I put a comma, I get either the same error or the error that say "If takes 2-3 parameters.
Thanks
Bruce
You've placed quite wrong. Perhaps this?
=if([ABS_TYPE]='Centers',rgb(642,67,67),if([ABS_TYPE]='Grant',rgb(25,58,223),if([ABS_TYPE]='Fellow',rgb(0,204,0),if([ABS_TYPE]='SBIR',rgb(255,37,249),if([STAR]='Y',rgb(255,255,51))))))
You've placed quite wrong. Perhaps this?
=if([ABS_TYPE]='Centers',rgb(642,67,67),if([ABS_TYPE]='Grant',rgb(25,58,223),if([ABS_TYPE]='Fellow',rgb(0,204,0),if([ABS_TYPE]='SBIR',rgb(255,37,249),if([STAR]='Y',rgb(255,255,51))))))
Thanks Anil, the expression checks OK, but I am not getting the yellow for the STAR if. I will try to figure out why that is.
Qlik is Case sensitive when we are comparing. Else, There is no wrong in the statement.
=if([ABS_TYPE]='Centers',rgb(642,67,67),if([ABS_TYPE]='Grant',rgb(25,58,223),if([ABS_TYPE]='Fellow',rgb(0,204,0),if([ABS_TYPE]='SBIR',rgb(255,37,249),if([STAR]='y',rgb(255,255,51))))))