-1
Partner UserID Marks Group
A 1 4 AM
A 2 7 AM
A 1 4 AM
B 3 5 CM
C 4 6 TM
B 3 5 CM

I want to calculate sum of 'Marks' for each partner excluding double rows.

I've tried (sum(maxOver(Marks, [UserID, Partner], PRE_AGG))). But it's giving me a table like :

Partner Marks
A 15
B 10
C 6

Whereas, I want a table as below :

Partner Marks
A 11
B 5
C 6

Thank you for your help, cheers!

Shan
  • 1
  • Does this answer your question? [(Quicksight) How to Sum Values only from Unique Fields](https://stackoverflow.com/questions/57170840/quicksight-how-to-sum-values-only-from-unique-fields) – Chaitanya Dec 13 '22 at 10:50

1 Answers1

0

You can create a calculated field with a countOver() function to detect the duplicate rows, and then use it as a filter in a sumIf() function. Example:

sumIf({Marks},countOver({Marks,[{Partner},{UserID},{Marks},{Group}],PRE_AGG)=1)
santi_jota
  • 36
  • 5