Skip to main content
3 of 3
deleted 33 characters in body
Alan
  • 13.8k
  • 21
  • 41

Edited in response to change in question added in a comment:

data = Dataset@Table[Association[
     "Sector" -> RandomChoice[{"Energy", "Env"}],
     "Supplier" -> StringTemplate["N``"]@RandomInteger[5],
     "Stage" -> StringTemplate["Stage``"]@RandomInteger[5],
     "Amount" -> 1000*RandomInteger[200]
     ], 100];
grp = GroupBy["Supplier"]
data[grp, Total, "Amount"]

Your comment says you only want to total over a Stage1 and Stage 2, so select for these.

sel = Select["Stage1" == #Stage || "Stage2" == #Stage &]
data[sel][grp, Total, "Amount"]
Alan
  • 13.8k
  • 21
  • 41