Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys.
I need help with an if statement.
I have two columns in a table.
Column A and Column B
I want to write statement to say
When Column B is NULL to Column A then give the value Unknown
So far i have only wrote an if statement for Column B but it is still not working
if(len(trim(ColumnB)) = 0, 'Unknown', ColumnB) as ColumnB,
Thanks,
Aaron
try this
if(isnull(ColumnB),'Unknown', ColumnA) as ColumnB,
Normally your approach should work but maybe there are any other not visible chars within ColumnB. To check on them you could copy these values into an editor like notepad ++ or checking them within Qlik with functions like len(), mid() and ord() or you could also try something like: keepchar(ColumnB, 'a..zA..Z0..9') to clean the fieldvalues before apply any checking.
- Marcus
It says Column A is not found
I don't understand what you are trying to do.. Where is column A in your example? Can you add a example file?