none
IF without Else - Circular Referemce RRS feed

  • Question

  • Hi,

    Is there any way of doing an IF statement without the Else?  

    Example

    #TableName=Source....

    renameColumn=if Table.HasColumn(#TableName, colname) then Table.RenameColumns(#TableName,{"NewName",colname}),  <--- I don't need the else.  Or can I use else #TableName?

    I'm getting circular reference errors and I think this is the cause

    Thanks

    Alex


    Thursday, July 2, 2015 4:53 PM

Answers

All replies

  • The ELSE is required. You can use else #"TableName" if that's the value you're trying to carry forward, yes.
    Friday, July 3, 2015 8:35 AM
  • Hi Alex. Regarding the circular reference errors, you might be getting those if TableName is a query, and renameColumn is a step in the TableName query. To refer to the original table without creating a circular reference, you should refer to the Source step (or the name of the step right before renameColumn) instead of referring to TableName.

    Ehren

    Monday, July 6, 2015 7:52 PM
    Owner