Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: 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?

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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.