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

How to get a count of field2 for each field1 basedo

Hello users, I am new to the community and QV usage.  Struggling how to accomplish it in Qlikview Here is how my data is and the result I want to produce.  Appreciate the help.  I tried the count if distinct option, but it is not working for some reason.  As you can see from the data (left three columns), I want to product the results (right 2 columns).  In my result I do not need to show the states, but just the count of states for each month, where the calls are over 25.

Thank you.

Data:                                                       Result

 

MonthStateCalls
JanAK25MonthCount of States with >25 calls
JanAL27Jan2
JanIL15Feb2
FebAK14March5
FebAL50April4
FebMS200
FebTN10
MarchNJ9
MarchNY150
MarchTX25
MarchTN24
MarchNM33
MarchUT90
MarchSD56
AprilNJ45
AprilNY55
AprilTX83
AprilTN31
AprilNM12
13 Replies
Not applicable
Author

Thank you for your responses, the expression is working.  I just didn't realize my data has one more segment within State.  Here is how it looks:

1) So the calls total has to be first aggregated to State level from all Zones, then the state sum has to be checked against 25.

2) The result should still display all 12 months, even if there are months that do not have any states with > 25, it should still show that month, with a blank for state count

Thank you all.

MonthStateZoneCalls
JanAK110
JanAK210
JanAK35
JanAL19
JanAL29
JanAL39
JanIL315
FebAK15
FebAK25
FebAK35
FebAL250
FebMS3200
FebTN210
Not applicable
Author

Thank you Dan, the expression is working.  Now I got your attachment, sorry I didn't see it first, not sure if moderator has to first approve it. I just didn't realize my data has one more segment within State.  Here is how it looks:

1) So the calls total has to be first aggregated to State level from all Zones, then the state sum has to be checked against 25.

2) The result should still display all 12 months, even if there are months that do not have any states with > 25, it should still show that month, with a blank for state count

Thank you!

MonthStateZoneCalls
JanAK110
JanAK210
JanAK35
JanAL19
JanAL29
JanAL39
JanIL315
FebAK15
FebAK25
FebAK35
FebAL250
FebMS3200
FebTN210
Not applicable
Author

Dear Users, I posted a further query on this as the data has one more dimension, but not sure if I posted it the correct way so that who all responded with answers see the updated question.  Do I have to post it as a new query, as I already marked my earlier question as "Answered" and then I re-posted with additional details?

Thank you.

Not applicable
Author

I just didn't realize my data has one more segment within State.  Here is how it looks:

1) So the calls total has to be first aggregated to State level from all Zones, then the state sum has to be checked against 25.

2) The result should still display all 12 months, even if there are months that do not have any states with > 25, it should still show that month, with a blank for state count

Thank you!

MonthStateZoneCalls
JanAK110
JanAK210
JanAK35
JanAL19
JanAL29
JanAL39
JanIL315
FebAK15
FebAK25
FebAK35
FebAL250
FebMS3200
FebTN210