I have a dataset similar to below:
Trip Id Amount
I want sum(amount) for distinct trip ids which should be: 25(10+10+5)
is aggr() an option?
Thanks in advance
Consider changing your data model in a way your fact table only shows a single record per fact value, i.e. try to avoid data duplication caused by e.g. joining tables.
Then a simple Sum(Amount) should return what you want.
It's better to spent the time on data modelling than fixing things later in (more complex) expressions.
However, there are no overall duplicate rows. There are other columns(not mentioned here) which make the entire row unique. I don't want to create a separate table just for a distinct sum.