I have a form with a repeating table of projects with budgets, and a project may be selected more than once:
field1 field2
Project A $20
Project B $30
Project A $20
Project C $10
I want to sum field2 for the UNIQUE projects selected, e.g. A + B + C = $60 (not A + B + A + C = $80)
this doesn't sum anything: sum(my:group1/my:group2/my:field2[../my:field1[current()] != preceding-sibling::my:field1])
any ideas? thank you!