I have the following iif
statement in my sql query within excel.
iif(master.[Canada] = '0' or master.[Canada] = ' ' or master.[Canada] IS NULL,master.[USA], master.[Canada]) as Stackoverflow
but I want to add something like iff([Stackoverflow] is not null, [Stackoverflow], "n/a") as Stackoverflow
but cannot have duplicate alias'.
Does anyone know how to do two false conditions? I need to have my blanks in Stackoverflow column show as N/a.
the logic is like this,
+--------+--------+---------------+
| Canada | USA | Stackoverflow |
+--------+--------+---------------+
| 12345 | 35262 | 12345 |
| 15678 | 52367 | 15678 |
| | 97536 | 97536 |
| 17893 | 35252 | 17893 |
| 0 | 120321 | 120321 |
+--------+--------+---------------+
But what if stackoverflow is null, I want to put n/a's there
Trying something like:
iff(master.[Canada] <> ' ', iif(master.[Canada] = '0' or master.[Canada] = ' ' or master.[Canada] IS NULL,master.[USA], master.[Canada]), "n/a") as best_id
But cannot get it to work. undefined funcation iif