Forum Discussion

stormcloud79's avatar
stormcloud79
Regular Visitor
5 years ago
Solved

Token Comma Expected

Good morning, I know this has been posted a few times but I can't seem to work out in my instance where the fault is and I wonder if someone can help point out the error.

 

The line is in red I'm having a problem with below.

Many thanks Robin

 

let
Opportunity = let
Opportunity = let
Source = Cds.Entities("https://zonal.crm11.dynamics.com/", null),
entities = Source{[Group="entities"]}[Data],
opportunities = entities{[EntitySetName="opportunities"]}[Data]

in
opportunities,
#"Removed Columns" = Table.RemoveColumns(Opportunity,{"accountid", "budgetstatus_display", "budgetamount_base"}),
#"Expanded owninguser" = Table.ExpandRecordColumn("owninguser", {"fullname"}, {"owninguser.fullname"})
in
#"Removed Columns",
#"Removed Other Columns" = Table.SelectColumns(Opportunity,{"actualclosedate", "actualvalue", "closeprobability", "createdon", "customerid", "estimatedclosedate", "estimatedvalue", "name", "new_mrrtotal", "new_ooftotal", "opportunityid", "opportunityratingcode", "opportunityratingcode_display", "salesstage", "salesstage_display", "salesstagecode", "salesstagecode_display", "stageid", "statecode", "statecode_display", "statuscode", "statuscode_display", "stepid", "stepname", "znl_conversiondays", "znl_hostingrevenue", "znl_hostingrevenueannual", "znl_hostingrevenuecontract", "znl_maintenancerevenue", "znl_numberofsites", "znl_opportunitytype", "znl_opportunitytype_display", "znl_saasrevenue", "znl_saasrevenueannual", "znl_saasrevenuecontract", "znl_salesrevenue", "znl_salesrevenueservices", "znl_salesrevenuesoftware", "znl_servicesvalue", "znl_softwarevalue"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Other Columns",{{"actualclosedate", "Actual Close Date"}, {"actualvalue", "Actual £ Revenue"}, {"closeprobability", "Close % Probability"}, {"createdon", "Created On"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Created On", type date}}),
#"Renamed Columns1" = Table.RenameColumns(#"Changed Type",{{"estimatedclosedate", "Estimated Close Date"}, {"estimatedvalue", "Estimated £ Revenue"}, {"name", "Opportunity Name"}, {"opportunityratingcode", "Rating Code"}, {"opportunityratingcode_display", "Rating Name"}, {"salesstage", "Sales Stage"}, {"salesstage_display", "Sales Stage Name"}, {"statecode_display", "State (O/W/L)"}, {"statuscode_display", "State Reason"}, {"stepname", "BPF Name"}, {"znl_conversiondays", "Days to Win/Loss"}, {"znl_hostingrevenue", "Hosting £ Revenue"}, {"znl_maintenancerevenue", "Maintenance £ Revenue"}, {"znl_numberofsites", "No Sites"}, {"znl_opportunitytype_display", "Opportunity Type"}, {"znl_saasrevenue", "SaaS £ Revenue"}, {"znl_salesrevenue", "Sales £ Revenue"}})
#"Inserted Month" = Table.AddColumn(#"Renamed Columns1", "Month", each Date.Month([Actual Close Date]), Int64.Type),
#"Renamed Columns2" = Table.RenameColumns(#"Inserted Month",{{"Month", "Actual Close Month"}}),
#"Inserted Month1" = Table.AddColumn(#"Renamed Columns2", {{"Month", each Date.Month([Estimated Close Date]), Int64.Type}}),
#"Renamed Columns3" = Table.RenameColumns(#"Inserted Month1",{{"Month", "Estimated Close Month"}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns3",{"Actual Close Month", "Estimated Close Month"}),
#"Added Conditional Column" = Table.AddColumn(#"Removed Columns", "Opportunity Overall State", each if [#"State (O/W/L)"] = "Lost" then "Closed" else if [#"State (O/W/L)"] = "Won" then "Closed" else "Open"),
#"Renamed Columns4" = Table.RenameColumns(#"Added Conditional Column",{{"Sales £ Revenue", "Hardware £ Revenue"}, {"znl_salesrevenueservices", "Services £ Revenue"}, {"znl_salesrevenuesoftware", "Software £ Revenue"}}),
in
#"Removed Columns1"

 

 

 

  • Hi stormcloud79 ,

     

    It's not that line that is the problem, it's the previous line that doesn't have a comma at the end and it should.

     

    Pete

3 Replies

  • Hi stormcloud79 ,

     

    It's not that line that is the problem, it's the previous line that doesn't have a comma at the end and it should.

     

    Pete

    • stormcloud79's avatar
      stormcloud79
      Regular Visitor

      Thanks, I'm not sure how that became missing as it was  int he original text I copied and pasted to notepad

       

       

      • v-robertq-msft's avatar
        v-robertq-msft
        Community Support

        Hi, stormcloud79 

        Glad to hear that you have solved your problem based on the reply of BA_Pete, would you like to mark his reply as a solution so that others can learn from it too?

        Thanks in advance!

        How to Get Your Question Answered Quickly 

         

        Best Regards,

        Community Support Team _Robert Qin

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.