Search code examples
if-statementalteryx

Alteryx Designer Problem with IF Statement


can anyone see a problem with this IF Statement. I get an error while I run in Alteryx.

if !isnull([Opening Balance Total]) then [Opening Balance Total] or

if !IsNull([Closing Balance Total]) then [Closing Balance Total] else ""

endif


Solution

  • The "or" needs to be an "else", and you'll need another Endif also... here are these mods, also with indentation to make it more clear:

    If !IsNull([Opening Balance Total]) then
        [Opening Balance Total]
    else 
        if !IsNull([Closing Balance Total]) then
            [Closing Balance Total]
        else
            ""
        endif
    endif