none
Error - Expression.SyntaxError: Token Comma expected RRS feed

  • Question

  • (startdate, enddate)=>
    let
        Source = Sql.Database("GCH-CARESYS", "CARESYS"),
        dbo_cs_clients = Source{[Schema="dbo",Item="cs_clients"]}[Data],
        #"Merged Queries" = Table.NestedJoin(dbo_cs_clients, {"facility"}, cs_facilities, {"guid"}, "cs_facilities.1", JoinKind.LeftOuter),
        #"Expanded cs_facilities.1" = Table.ExpandTableColumn(#"Merged Queries", "cs_facilities.1", {"name"}, {"cs_facilities.1.name"}),
        #"Filtered Rows" = Table.SelectRows(#"Expanded cs_facilities.1", each ([status] <> 0)),
        #"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows",{{"DOB", type date}, {"ADMISSION", type date}, {"leaveDate", type date}}),
        #"Filtered Rows1" = Table.SelectRows(#"Changed Type", each [leaveDate] = #date(1900, 1, 1) or [leaveDate] > #date(Date.Year(startdate), Date.Month(startdate), Date.Day(startdate)),
        #"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each [ADMISSION] < #date(Date.Year(enddate), Date.Month(enddate), Date.Day(enddate)),
        #"Merged Queries1" = Table.NestedJoin(#"Filtered Rows2", {"defaultServiceType"}, ci_products, {"guid"}, "ci_products", JoinKind.LeftOuter),
        #"Expanded ci_products" = Table.ExpandTableColumn(#"Merged Queries1", "ci_products", {"description"}, {"ci_products.description"}),
        #"Filtered Rows3" = Table.SelectRows(#"Expanded ci_products", each ([ci_products.description] <> "Day Care "))
    in
        #"Filtered Rows3"
    Friday, July 26, 2019 4:35 PM

Answers

  • Just add right parentheses at the end of these steps:

     #"Filtered Rows1" = Table.SelectRows(#"Changed Type", each [leaveDate] = #date(1900, 1, 1) or [leaveDate] > #date(Date.Year(startdate), Date.Month(startdate), Date.Day(startdate))),
     #"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each [ADMISSION] < #date(Date.Year(enddate), Date.Month(enddate), Date.Day(enddate))),

    Friday, July 26, 2019 8:20 PM

All replies

  • Just add right parentheses at the end of these steps:

     #"Filtered Rows1" = Table.SelectRows(#"Changed Type", each [leaveDate] = #date(1900, 1, 1) or [leaveDate] > #date(Date.Year(startdate), Date.Month(startdate), Date.Day(startdate))),
     #"Filtered Rows2" = Table.SelectRows(#"Filtered Rows1", each [ADMISSION] < #date(Date.Year(enddate), Date.Month(enddate), Date.Day(enddate))),

    Friday, July 26, 2019 8:20 PM
  • Generally, if you're really struggling to find the error, try commenting blocks of code out with /* and */ and changing the step chosen by the "in" expression. That way you can go through the steps finding out which ones work and which ones don't. 
    • Edited by CamWally Saturday, July 27, 2019 11:54 AM
    Saturday, July 27, 2019 11:53 AM