Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone!
I inherited a code piece that contains nested IF statements. Issue: somehow it stopped working...
The code is:
IF
( LEN(TRIM(sourceBL)) <> 0 AND IF( LEN(TRIM(sourcePortfolio)) <> 0, 'ActiveBDS',
IF
( LEN(TRIM(sourceBL)) = 0 AND IF( LEN(TRIM(sourcePortfolio)) <> 0, 'NotActiveBDS',
IF
( LEN(TRIM(sourceBL)) = 0 AND IF( LEN(TRIM(sourcePortfolio)) = 0, 'Error',
IF
( LEN(TRIM(sourceBL)) <> 0 AND IF( LEN(TRIM(sourcePortfolio)) = 0, 'NotAssignedinPortfolio', 'XXXXX'))))))) asStatus
I just cannot see the syntax issue by myself...
Please help!
Here is a tool that might be usefull:
http://www.qlikblog.at/tools/Nested-If-Generator.html
Good luck.
Here is a tool that might be usefull:
http://www.qlikblog.at/tools/Nested-If-Generator.html
Good luck.
replace the "AND IF(" with "AND"
and remove 4 brackets "))))" and the end - this should do
HTH
Peter
Please try this and let me know:
If (LEN(TRIM(sourceBL)) <> 0 AND LEN(TRIM(sourcePortfolio)) <> 0, 'ActiveBDS' ,
IF(LEN(TRIM(sourceBL)) = 0 AND LEN(TRIM(sourcePortfolio)) <> 0, 'NotActiveBDS' ,
IF(LEN(TRIM(sourceBL)) = 0 AND LEN(TRIM(sourcePortfolio)) = 0, 'Error',
IF(LEN(TRIM(sourceBL)) <> 0 AND LEN(TRIM(sourcePortfolio)) = 0, 'NotAssignedinPortfolio', 'XXXXX')))) as Status
Thx! Helped a lot!
Hi,
Thiago
Tyr this,
=
IF( LEN(TRIM(sourceBL)) <> 0 , IF( LEN(TRIM(sourcePortfolio)) <> 0, 'ActiveBDS',
IF
( LEN(TRIM(sourceBL)) = 0 , IF( LEN(TRIM(sourcePortfolio)) <> 0, 'NotActiveBDS',
IF
( LEN(TRIM(sourceBL)) = 0 , IF( LEN(TRIM(sourcePortfolio)) = 0, 'Error',
IF
( LEN(TRIM(sourceBL)) <> 0 , IF( LEN(TRIM(sourcePortfolio)) = 0, 'NotAssignedinPortfolio', 'XXXXX')))))))) as StatusRegards
Kaushal Mehta