Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate the sum without repetitions

Hello,

I have the following table

table.PNG

I need to have the sum of MONTANT_TIT without repetitions.

Knowing that the NUMDOM can only have 1 MONTANT_TIT.

Thank you

1 Solution

Accepted Solutions
sunny_talwar

Try this

Sum(Aggr(MONTANT_TIT, NUMDOM))

or

Sum(Aggr(Avg(MONTANT_TIT), NUMDOM))

or

Sum(Aggr(Sum(DISTINCT MONTANT_TIT), NUMDOM))

View solution in original post

7 Replies
Anil_Babu_Samineni

Not sure when you say reputation?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

Try this

Sum(Aggr(MONTANT_TIT, NUMDOM))

or

Sum(Aggr(Avg(MONTANT_TIT), NUMDOM))

or

Sum(Aggr(Sum(DISTINCT MONTANT_TIT), NUMDOM))

vishsaggi
Champion III
Champion III

WHere are you displaying this data? I mean which object you are displaying this data in Qlikview. Usually QV will take care of the duplicates automatically unless you have any other dimension which is not duplicate and linked to this data.

jonvitale
Creator III
Creator III

Yasmine,

You can certainly use Sunny's Aggr commands, but is there a reason why you need the extra rows in the table? Do each of those rows contain some extra information that we are not seeing? If not, you should consider revising the load script so that the table only has unique rows. Try using "Load Distinct" in the load script.

Jonathan

Anonymous
Not applicable
Author

there are not duplicated because the date is important for my model, except in this situation i'm not using it.

Anonymous
Not applicable
Author

Thank you stalwar1‌ I got the correct result .

jonvitale
Creator III
Creator III

Just my 2 cents but,

If I were you I'd probably create a separate table that is an aggregation of this table. It seems to me, that with the Qlik associative engine, you really don't need a table with lot's of repeated information. Create a table with one row per NumDot.

But, hey, that's just my opinion, man.