Forum Discussion
invalid identifier for list.sum syntax
- 6 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
that's probably due to the special characters in the field name. Try to escape it like so: [#"C/O"].
- gavin0076 years ago
Helper V
ImkeF It partialy work but it then it has error message like "We cannot convert the value 380000 to type Function."
Is there something wrong with the type?
- ImkeF6 years ago
Community Champion
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}})
- Anonymous6 years agoNot applicable
hi gavin007
I wonder if you wanted to add [Rev Act] for the entire Source table or just for each sub-group.
In the latter case, you should replace Source with _.then from
Table.SelectRows(Source, each [I/C]="C") [Rev Act])
to
Table.SelectRows(_, each [I/C]="C") [Rev Act])
In general, for faster and more useful help you should provide the expected and the input data and if any error appears in your code, the complete copy of the code used.