Skip to main content
Announcements
See why Qlik was named a Leader in the 2025 Gartner® Magic Quadrant™ for Augmented Data Quality Solutions: GET THE REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

ListBox Expression

I have an expression =Count(DAYS_PENDING) for a stragiht table with dimensions Division, Region and PendingBucket. 

I would like to create a list box that represents the straight table above, into two categories. Assigned vs UnAssigned. If count is greater then 1 Unassigned, else Assigned.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I was able to create a Case Statement in my Script to solve the problem.

CASE

   WHEN A.FIRST_ASSGN_DT IS NOT NULL

   THEN 'Assigned'

   WHEN A.FIRST_CONTACT_DT IS NOT NULL THEN 'Assigned'

   WHEN A.FIRST_VISIT_DT IS NOT NULL THEN 'Assigned'

   ELSE 'UnAssigned'

   END Assigned

View solution in original post

5 Replies
miguelbraga
Partner - Specialist III

Hey there,

Do you have a sample qvw that you can share, so that we can make you a solution for your issue?

Regards,

MB

Anil_Babu_Samineni

Try This


If(Count(DAYS_PENDING) > 1,'Unassigned', 'assigned')


OR


If(Len(Count(DAYS_PENDING)) > 1,'Unassigned', 'assigned')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
effinty2112
Master

Hi John,

                    As a first attempt create a listbox with this expression:

=Aggr(If(count(DAYS_PENDING) >1,'Assigned','Unassigned'), FieldName)

The thing to figure out here is the Fieldname to choose, try it on the dimension with the finest granularity.

I think there might be a bit of work to be done on the logic behind your requirements before we can get a solution.

Good luck

Andrew

sunny_talwar

This would create the two buckets for you, but will not work well based on selections

Aggr(If(Count(DAYS_PENDING) > 1, 'Unassigned', 'Assigned'), Division, Region and PendingBucket)

Can you do the count in the script to create the flag for unassigned and assigned?

Anonymous
Not applicable
Author

I was able to create a Case Statement in my Script to solve the problem.

CASE

   WHEN A.FIRST_ASSGN_DT IS NOT NULL

   THEN 'Assigned'

   WHEN A.FIRST_CONTACT_DT IS NOT NULL THEN 'Assigned'

   WHEN A.FIRST_VISIT_DT IS NOT NULL THEN 'Assigned'

   ELSE 'UnAssigned'

   END Assigned