none
Question about how to resolve a 'Token Eof Expected Error' RRS feed

  • Question

  • This is the query that I am trying use in Power BI. When submitting, there is an Expression.SyntaxError: Token Eof expected. error. The indicator is showing the error is on the last ). What does it mean and how can I resolve it?

    = Table.AddColumn(#"Removed Other Columns1", "AgingSubmission", each if [Submission_Status] = "Ready For Test" then ([Case_Created_Date]-TODAY()) else if [Submission_Status] = "In Process" then ([Case_Created_Date]-TODAY()) else ([Case_Created_Date]-[Submission_LastViewedDate])))


    Ginger Pearl-Berg

    Monday, November 26, 2018 5:39 PM

Answers

  • Table.AddColumn(
        #"Removed Other Columns1", 
        "AgingSubmission", 
        each if [Submission_Status] = "Ready For Test" then 
                [Case_Created_Date]-DateTime.Date(DateTime.LocalNow())
             else if [Submission_Status] = "In Process" then 
                     [Case_Created_Date]-DateTime.Date(DateTime.LocalNow()) 
             else [Case_Created_Date]-[Submission_LastViewedDate]
    )
    If date columns are of datetime type (and not date type), then remove the DateTime.Date wrapper in the appropriate places.


    Monday, November 26, 2018 9:17 PM

All replies

  • Table.AddColumn(
        #"Removed Other Columns1", 
        "AgingSubmission", 
        each if [Submission_Status] = "Ready For Test" then 
                [Case_Created_Date]-DateTime.Date(DateTime.LocalNow())
             else if [Submission_Status] = "In Process" then 
                     [Case_Created_Date]-DateTime.Date(DateTime.LocalNow()) 
             else [Case_Created_Date]-[Submission_LastViewedDate]
    )
    If date columns are of datetime type (and not date type), then remove the DateTime.Date wrapper in the appropriate places.


    Monday, November 26, 2018 9:17 PM
  • Hi Ginger. Just to clarify: you were getting that error because you had an extra right-parenthesis at the end of your custom column expression. If you delete the final right-paren from the example code you pasted above, this should resolve the Eof error.

    Ehren

    Monday, December 3, 2018 7:22 PM
    Owner