Ifelse Lead calculation bringing back 'incorrect syntax'

I’m attempting to address an issue with duplicated data (that pulls from another source), and am trying to use the following calculation to address it. So far, I keep running into the same syntax issue when attempting to save, but I’m unsure where/which section of the syntax is incorrect.

Calculation: ifelse(lead({order_id},[{order_date} ASC],1)=firstValue({order_id]},[{order_date} ASC],[{order_date}]),‘Duplicate’,‘Keep’)

I’ve attempted the following:

  • Order ID as string,
  • Order ID as decimal/int,
  • toString(order_date)

Any solutions or workarounds would be great. In an ideal world I understand that the source data should be clean as possible but this currently isn’t available.

Your order_id is wrong. It should be {order_id} not {order_id]}.

When I fixed this it worked for me.


Thank you - good spot! The other thing that I also needed to fix were the quotation marks, copy and pasting the formula put in the wrong ones.

1 Like