I try to group values in a double dimension table in an other table, but without duplicates. All attempts i made create a table with duplicates.
Here's an example:
This is my table:
tab1 = {
{id = "id1", dmg = 0, qty = 1},
{id = "id2", dmg = 0, qty = 1},
{id = "id3", dmg = 0, qty = 1},
{id = "id1", dmg = 0, qty = 1},
}
and i would like an other table like that:
tab2 = {
{id = "id1", dmg = 0, qty = 2},
{id = "id2", dmg = 0, qty = 1},
{id = "id3", dmg = 0, qty = 1},
}
So i want my qty values to be summed and tables to be groupe like in the example. Does Someone have an idea for this problem ? Is there a function to do this ?
Thanks for your answers. Sorry if my english is bad, it's not my native language.