Skip to main content
Announcements
Do More with Qlik - Qlik Cloud Analytics Recap and Getting Started, June 19: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count and sum

I have a interesting Problem,..

                 ID          Value
2300:02:00
2300:02:00
2400:04:30

i have this table and i want for der result of the value 00:06:30 because the ID 23 is double and than distinct of the ID is 1.

00:02:00 and 00:04:30 is 00:06:30. But i have problems with the if clause. I tried the folling expression :

if(count(ID) = count(distinct ID),Value) as NewValue

but it not work with sum because of the if clause that i can sum all values..also i tried to put it in the script but "invalid expression"

3 Replies
Not applicable
Author

Hi,

are You talking about loading data from source?

If I understand well you want to sum up all the same ID's?

Yo can use straight table after loading data =sum(DISTINCT Value)

rrsrini2907
Creator
Creator

Hi,

In the script you can create a resident load there add the prefix Distinct on field name.

So it creates unique record for ID and value. Alias the value as DistValue and use sum function on DistValue.

Regards,

Srini.

Sokkorn
Master
Master

Hi,

Try expression like this : INTERVAL(SUM(DISTINCT Value),'h:mm:ss')

Let me know if this help you.

Regards,

Sokkorn