Forum Discussion

cmjcf's avatar
cmjcf
Frequent Visitor
5 days ago
Solved

iifnull() failing on non-null input

The documentation for iifNull() says this:

Returns the first not null item when given two or more inputs. 

We have a dataflow which handles the contents of a number of files, using a specified CSV format.  One of the columns is named 'Dealer'.  Due to an error in an upstream system, a significant number of files came in with the header misspelled 'Delaer'.  There are so many of these files that we cannot simply edit them manually to fix.  I have the following expression in a Derived Column transform:

iifNull('Dealer',byName('Delaer'))

I understand this expression to mean "Use the value of the column 'Dealer' if it is not null, else use the value of the drifted column 'Delaer'."  (That name is not in the list set by the dataset, so it is drifted, and leaving out byName() causes validation to fail.)

When the file does not contain the spelling error, my expected result is that it simply retains the correct value in 'Dealer' because this is not null.  However, when actually run, this expression actually returns null, and causes the column in the Derived Column transform to not be created, resulting in a "Resolved attribute(s) [name] missing from [names]" error.

3 Replies

Replies have been turned off for this discussion