Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
yasmine_benatti
New 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

Re: Calculate the sum without repetitions

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

Re: Calculate the sum without repetitions

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)

Re: Calculate the sum without repetitions

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
Esteemed Contributor III

Re: Calculate the sum without repetitions

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
Contributor III

Re: Calculate the sum without repetitions

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
New Contributor

Re: Calculate the sum without repetitions

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

yasmine_benatti
New Contributor

Re: Calculate the sum without repetitions

Thank you stalwar1‌ I got the correct result .

jonvitale
Contributor III

Re: Calculate the sum without repetitions

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.