For a unique transaction-number you should hardcode this in the script. Other calculations can be done in simple table/graphs, just with your required aggregation as Expression and required dimension. In the first approach think that this should do - you may then go lateron into more sophisticated formulas.