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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested If or Aggr query

Hi All,

I hope someone might be able to help me as I have been struggling with an expression. I have tried both a Sum(If and an aggregated sum but cant get it to do quite what I want.

I have a set of data as below

InNumberFormKey101FormNoCounter
110725115719121291
110725115719121321
110725115719277661
110725115719318217471061
110725115719336931
110725115719352477471061
110725115719925367471051
110725115720273567471041
110725115720273577471071

I need to do a count of the 101FormNo column for each InNumber which as it stands would return 5, my problem is that if the InNumber has more than 1 101FormNo's against it I only want to return the value 1. I just need to know if there is a value for each InNumber and not how many there are or when I try to do a % completion formula instead of getting 100% to say there is a match I get 500% which when you expand this to the full dataset causes the figure to be skewed.

Any help would be appreciated

Thanks

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like

=sum(aggr( if(count([101FormNo]),1,0) ,InNumber))

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe like

=sum(aggr( if(count([101FormNo]),1,0) ,InNumber))

Not applicable
Author

Thanks for you help that worked really well. My calculations look much better now.