Input collection: mySales25
Item | UnitsSold | PricePerUnit |
Notebook | 25 | 2.5 |
Crayons | 15 | 8.62 |
Binders | 10 | 13.34 |
Pencils | 21 | 1.5 |
Erasers | 30 | 0.89 |
Output value: mySolution25 (SUM of UnitsSold * PricePerUnit)
383.4 |
Solution code:
//Create a collection
ClearCollect(mySales25,
{Item: "Notebook", UnitsSold: 25, PricePerUnit: 2.5},
{Item: "Crayons", UnitsSold: 15, PricePerUnit: 8.62},
{Item: "Binders", UnitsSold: 10, PricePerUnit: 13.34},
{Item: "Pencils", UnitsSold: 21, PricePerUnit: 1.5},
{Item: "Erasers", UnitsSold: 30, PricePerUnit: 0.89}
);
//Calculate the SumProduct code
Set(mySolution25,Sum(mySales25,UnitsSold * PricePerUnit));