Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm new Qlikviewer, Please help me
My problem is I can't Distinct and sum value T_T
My data is
ID | MONEY |
---|---|
1 | 500 |
1 | 500 |
2 | 300 |
2 | 300 |
3 | 300 |
3 | 300 |
4 | 500 |
I want to distinct ID and sum MONEY
is
ID | Header 2 |
---|---|
1 | 500 |
2 | 300 |
3 | 300 |
4 | 500 |
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
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.
Create the straight table
Dimension : ID
Expression :
sum(distinct MONEY)
Check expression total mode as "Sum of rows"
In any straight table
Dim:- ID
Expre:- sum(Disctinct MONEY)
Regards
Anand
Dimension: ID
Exp: =SUM(DISTINCT MONEY)
or try dis
dim:ID
Exp :=Sum(Aggr(DISTINCT(MONEY), ID))
!Hi,
Use :
=Sum(Aggr(sum(DISTINCT Money),ID))
Attached sample for the same.
Regards,
Anjali Gupta
In addition these should also work:
=Sum(Aggr(Avg(Money), ID)
or
=Sum(Aggr(Sum(DISTINCT Money), ID)
Hi, Amornsak Nakvisut.
Another suggestion is, you can treat the script. See example below.
Script
VALUE:
LOAD * Inline [
ID, MONEY
1, 300
1, 300
2, 500
2, 500
3, 300
3, 300
4, 500
];
NoConcatenate
VALUE_MONEY:
LOAD
Distinct
ID,
MONEY
RESIDENT VALUE;
DROP TABLE VALUE;
Document
Dimension: ID
Expression: Sum(MONEY)
Hope this helps!