HereIf the you want to total all columns instead of just those on a select list, then the suggestion given by @Kuba is one wayappropriate:
ds[All, <| #, "colnew" -> Total@# |> &]
If you wish to total only the listed columns, then:
ds[All, <| #, "colnew" -> Total[#[[list]]] |> &]
For example:
list = {"col1", "col2", "col3"};
ds = AssociationThread[list->#]& /@ RandomInteger[10, {4, 3}] // Dataset
list = {"col1", "col2", "col3"}
ds[All, <| #, "colnew" -> Total[#[[list]]] |> &]
If the you want to total all columns instead of just those on a select listOr, then the suggestion given by @Kuba is appropriateasking for an actual subset of columns:
list2 = {"col1", "col2"};
ds[All, <| #, "colnew" -> Total@#Total[#[[list2]]] |> &]