How to Group Data, calculate Group percentage and insert Group Report summary line

@lentvalent
lets assume following dataset (simplified IDs, 2 cols)
grafik

Flowdescription:
preparing report datatable:
grafik

Grouping data:
grafik

Groups is of datatype: List(Of List(of Datarow)) outer list=groups, inner list=groupmembers

Group processing:

group sum: grp.Sum(Function (x) CInt(“0” & x(“Count”).toString))
group member add datarow: {gmbr(0),gmbr(1), (CInt(“0” & gmbr(1).toString)/Sum*100).toString(“F1”)}
report summary line (hardcoded 100% due rounding deviation fixes): {nothing,Sum, “100%”}

Result:
grafik

find starter help here:
GroupBy_1Col_AddStatisticSepRow.xaml (11.1 KB)

also have a look here:

1 Like