Forum Discussion

JimT99's avatar
JimT99
Helper I
4 years ago
Solved

If statement gives error token leftbracket expected

Im getting a token leftBracket expected error:
I'm trying to add a "0" to the end of the field LotTxt if the length of the text is not 10.

Column = IF(LEN(Grading_data[lotTxt]) =10, grading_data[[LotTxt], CONCATENATE(grading_data[LotTxt]),"0")

3 Replies

    • JimT99's avatar
      JimT99
      Helper I

      yes...that was it. (Embarassed).  Now it tells me that "If" isn't recognized.

      Expression.Error: The name 'If' wasn't recognized. Make sure it's spelled correctly.

  • tackytechtom's avatar
    tackytechtom
    Most Valuable Professional

    Hi JimT99 .

     

    Not sure why it says this, but when I pasted your formular into my PBI the CONCATENATE function also had some small issue.

     

    Can you try it with the following syntax?
    Column = IF(LEN(Grading_data[lotTxt]) =10, grading_data[LotTxt], CONCATENATE(grading_data[LotTxt],"0"))

     
    Let me know if this helps and do not forget to mark the answer 🙂