Forum Discussion
invalid identifier for list.sum syntax
- 5 years ago
Hi gavin007 ,
yes, I didn't pay attention to the other code. Problem is, that you have used the "each"-keyword twice and now the syntax sugar doesn't know what to refer to.
Therefore I'd recommend to transform at least one of the functions to the explicit syntax:Table.Group(Source, {"InvoiceDate", "OrderNo_Revised_Item"}, {{"Ext Rev Act", each List.Sum(Table.SelectRows(Source, (row) => row[#"I/C"]="C") [Rev Act]), type nullable number}, {"GM Act", each List.Sum([GM Act]), type nullable number}})
Hi gavin007 ,
yes, I didn't pay attention to the other code. Problem is, that you have used the "each"-keyword twice and now the syntax sugar doesn't know what to refer to.
Therefore I'd recommend to transform at least one of the functions to the explicit syntax:
Table.Group(Source, {"InvoiceDate", "OrderNo_Revised_Item"}, {{"Ext Rev Act", each List.Sum(Table.SelectRows(Source, (row) => row[#"I/C"]="C") [Rev Act]), type nullable number}, {"GM Act", each List.Sum([GM Act]), type nullable number}})
ImkeF That is awsome. It is working perfecly. Can i humbly ask how and where can i learn this syntax? I am good with click and drop but when it comes to scripting, expecially with the M language structue, i find it difficult to write a script like that.
- ImkeF5 years agoCommunity Champion
Hi gavin007 ,
glad to hear that it worked for you.
I've collected some learning resources here: https://www.thebiccountant.com/learning-resources/