# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for
Did you mean:
Not applicable

## Help me pls, I can't Distinct and Sum T_T

My problem is I can't Distinct and sum value T_T

My data is

IDMONEY
1500
1500
2300
2300
3300
3300
4500

I want to distinct ID and sum MONEY

is

1500
2300
3300
4500

so sum money is 500+300+300+500 = 1600 from distinct ID

and I want to use codes in Expression on Graph object

Thank you and Sorry for my English language

8 Replies

Perhaps:

Sum(Aggr(Only(MONEY), ID))

Or

Sum(Aggr(Max(MONEY), ID))

But you may want to fix your data model to remove the duplicates.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

Create the straight table

Dimension : ID

Expression :

sum(distinct MONEY)

Check expression total mode as "Sum of rows"

MVP

In any straight table

Dim:- ID

Expre:- sum(Disctinct MONEY)

Regards

Anand

Champion III

Dimension: ID

Exp: =SUM(DISTINCT MONEY)

Champion III

or try dis

dim:ID

Exp :=Sum(Aggr(DISTINCT(MONEY), ID))

Not applicable
Author

!Hi,

Use :

=Sum(Aggr(sum(DISTINCT Money),ID))

Attached sample for the same.

Regards,

Anjali Gupta

MVP

In addition these should also work:

=Sum(Aggr(Avg(Money), ID)

or

=Sum(Aggr(Sum(DISTINCT Money), ID)

Specialist

Hi, Amornsak Nakvisut.

Another suggestion is, you can treat the script. See example below.

Script

VALUE:

ID, MONEY

1, 300

1, 300

2, 500

2, 500

3, 300

3, 300

4, 500

];

NoConcatenate

VALUE_MONEY:

Distinct

ID,

MONEY

RESIDENT VALUE;

DROP TABLE VALUE;

Document

Dimension: ID

Expression: Sum(MONEY)

Hope this helps!

Community Browser