I have a list of associations. I will need to add 2 columns (or perform some other arithmetic operation) and put the answer in a new column. For example:
{<|Year->2014, ID->1, amt1->10, amt2->20|> <|Year->2015, ID->1, amt1->20, amt2->25|> <|Year->2014, ID->2, amt1->11, amt2->21|>} I want to get:
{<|Year->2014, ID->1, amt1->10, amt2->20, tot->30|> <|Year->2015, ID->1, amt1->20, amt2->25, tot->45|> <|Year->2014, ID->2, amt1->11, amt2->21, tot->32|>} Sometimes I will want to delete the amt1 and amt2, depending on what I'm doing at the time.
I've done this by converting this back into a list of values, operating on the list and putting it back into an association. But it seems like there must be a better way of doing this.