Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum the values matching a criteria

Hi guys,

I have a simple question that's making me crazy, but I'm a newbie in qlik and I'm doing some practice right now.

I have a data with these information:

ID          | Duration

1            | 10

2            | 4

3            | 5

1            | 6

5            | 9

2            | 12

I have to create an expression for a graph in order to get the sum of the duration for each IDs. The result I'm expecting is:

1 -> Sum: 16

2 -> Sum: 16

3 -> Sum: 5

... and so on for all the records in my data source.

How can I accomplish that? I have a strong background in excel and I was trying to look for a function like SUMIFS, but reading some of the posts in the community I noticed that the subject is different than I though.

Thanks to all

Maurizio

5 Replies
Not applicable
Author

Plz. see the attached and let me know if you any queries

ramoncova06
Specialist III
Specialist III

Hi Maurizio this can be done with set analysis A Primer on Set Analysis

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,


I think if you make the Dimension to be ID and your expression should just be

=Sum(Duration).

This should give you the of each ID.

Hope this helps

Not applicable
Author

Hi guys,

I've solved my doubt using this expression: =Sum( if( Type = '1' , Duration))

By the way, thanks to everybody for the replies

Not applicable
Author

you can also use sum({<Type ={'1'}>}Duration).

If you have got the help or answer. Then please close the thread by marking any question as answered or helpful

Thanks,

Singh