Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
On May 18th at 10AM EDT we will answer your QlikView questions live. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
yasmine_benatti
Contributor
Contributor

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?

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))

View solution in original post

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

yasmine_benatti
Contributor
Contributor
Author

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

yasmine_benatti
Contributor
Contributor
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.