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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

Please help with my function!

Hi guys,

I have a table as shown:

Salesrep Date  Customer  Item  Checked

  QQ         1-1         001          A          1

  QQ         1-1        001          B          0

  QQ         1-2        002          A          0

  QQ          1-3        002          B          1


For each salesrep, I want to show the number of visit with nothing checked in this 3-day period with each customer. The result for QQ should be like:

Customer  Count

     001          0

     002          1


My function is like:

SUM(IF(Aggr(SUM(Checked), Date&Customer)=0,1,0))


But it shows nothing at all. Please help! Thanks in advance!

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

SUM(IF(Aggr(SUM(Checked), Date,Customer)=0,1,0))

View solution in original post

3 Replies
sunny_talwar
MVP
MVP

What is the logic behind the output?

wanyunyang
Creator III
Creator III
Author

Customer 001 was only visited once (1-1), during this visit, A is checked, not blank visit. So blank visit count for customer 001=0.

Customer 002 was visited twice (1-2, 1-3). On 1-2, nothing is checked, one blank visit. On 1-3, B is checked, not blank visit. So blank visit count for customer 002=1.

sasiparupudi1
Master III
Master III

SUM(IF(Aggr(SUM(Checked), Date,Customer)=0,1,0))