Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
klikgevoel
Contributor III
Contributor III

Aggr Sum Distinct clause

Hi all,

 

Assume the following arbitrary dataset:

success_login, personid

1, P1

1, P1

1, P1

0, P1

1, P2

0, P2

0, P2

What I want is to use a solid statement that calculates the aggregated sum over success_login. As such, the end result would be this

success_login, personid, logins

1,P1,3

1,P2,1

I already tried it with =Aggr(Sum(success_login), personid). Which doesn't filter out the zeros (0). Using set analysis

=Aggr(Sum({1<success_login={1}>}), personid) gives me blank output. 

What's wrong with my approach?

Labels (2)
5 Replies
sunny_talwar

Why don't you just do that

Dimensions

sucess_login
person_id

Expression 

Sum(success_login)
dplr-rn
Partner - Master III
Partner - Master III

Why do you need aggr there.
below expression will work for what you have shown above
Sum({<success_login={1}>}success_login)
klikgevoel
Contributor III
Contributor III
Author

Apparently the answer is not so trivial in my situation due to the underlying data model. Second, apparently I had to employ some extra dimensions in my Table to get the actual values to appear.

dplr-rn
Partner - Master III
Partner - Master III

Share details of the problem with appropriate sample data and we can try to help
jwang2016
Partner - Contributor III
Partner - Contributor III

try to use count({<success_login={1}>})personid).