Token Comma Expected Error

Dorinda Reyes 1 Reputation point
2020-11-09T15:43:19.287+00:00

I am very very new to Power Query and have managed to get this written with some help up until the last comma error. I do not know how to even troubleshoot this.

Can someone help me figure out how to get this working please.

let
Source = Sql.Databases(Server),
GPFIS = Source{[Name = Database]}[Data],
dbo_IV00115 = GPFIS{[Schema = "dbo", Item = "IV00115"]}[Data],
#"Cleaned Text" = Table.TransformColumns( #"Grouped Rows" = Table.Group(dbo_IV00115, {"ITEMNMBR"}, {{"MyTable", each _, type table [ITEMNMBR=text, MANUFACTURER=text, MNFCTRITMNMBR=text, ITEMDESC=text, PRIMARYITEM=number, DEX_ROW_ID=number]}}),
#"Trimmed Text" = Table.TransformColumns(#"Cleaned Text",{{"MANUFACTURER", Text.Trim, type text}}),
#"Cleaned Text1" = Table.TransformColumns(#"Trimmed Text",{{"MNFCTRITMNMBR", Text.Clean, type text}}),
#"Trimmed Text1" = Table.TransformColumns(#"Cleaned Text1",{{"MNFCTRITMNMBR", Text.Trim, type text}}),
#"Added Custom" = Table.AddColumn(#"Trimmed Text1", "MANUFACTURER+MNFCTRITMNMBR", each [MANUFACTURER] & ": " & [MNFCTRITMNMBR]),
#"Grouped Rows" = Table.Group(#"Added Custom", {"ITEMNMBR"}, {{"Table", each _, type table [ITEMNMBR=nullable text, MANUFACTURER=text, MNFCTRITMNMBR=text, ITEMDESC=nullable text, PRIMARYITEM=nullable number, DEX_ROW_ID=nullable number, #"MANUFACTURER+MNFCTRITMNMBR"=text]}}),
#"Added Custom1" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.Column([Table], "MANUFACTURER+MNFCTRITMNMBR")),
#"Extracted Values" = Table.TransformColumns(#"Added Custom1", {"Custom", each Text.Combine(List.Transform(_, Text.From), "|"), type text})
in
#"Extracted Values"38441-error.png

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,936 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jake Bolton 1 Reputation point
    2020-11-12T23:59:25.717+00:00

    The code you posted is slightly different from the screenshot. The posted code has a missing value in the each statement
    This

    {"MyTable", each , type table
    

    Is right in the screenshot

         {"MyTable", each _, type table
    

    After fixing those I get the error "Token Comma Expected Error" which normally means you're missing a comma some where.
    This time it was a bit tricky. Line #5 is missing a closing parenthesis.
    Try:

    #"Cleaned Text" = Table.TransformColumns( #"Grouped Rows" = Table.Group(dbo_IV00115, {"ITEMNMBR"}, { {"MyTable", each 1, type table [ITEMNMBR=text, MANUFACTURER=text, MNFCTRITMNMBR=text, ITEMDESC=text, PRIMARYITEM=number, DEX_ROW_ID=number]}})),
    
    0 comments No comments