Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jmonroe918
Creator II
Creator II

Set Anaysis - Range Criteria

I am trying to create an expression that will filter and count records meeting the citeria of Open (not Closed), MDR = yes, and the Age is between 15 and 25 days. My expression (below) works correctly if I use only one of the age criterias (>14 or <26) but I can't figure out how to use the range.

=Count( Distinct {<
     [Complaints.Status]-={'Closed'},
     [Complaints.MDR]={'Yes'},
     [Complaints.Age (Days)] = {'>14','<26'}
>} [Complaints.Complaint No])

How does range criteria work in set analysis?

Thanks

Jeff

1 Solution

Accepted Solutions
Gysbert_Wassenaar

=Count( Distinct {<

     [Complaints.Status]-={'Closed'},

     [Complaints.MDR]={'Yes'},

    [Complaints.Age (Days)] = {'>14<26'}

>} [Complaints.Complaint No])


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

=Count( Distinct {<

     [Complaints.Status]-={'Closed'},

     [Complaints.MDR]={'Yes'},

    [Complaints.Age (Days)] = {'>14<26'}

>} [Complaints.Complaint No])


talk is cheap, supply exceeds demand
jmonroe918
Creator II
Creator II
Author

I was so close; didn't remove the space wehn I deleted the comma.

Thank you Gysbert!

Jeff

jmonroe918
Creator II
Creator II
Author

Another quick one:

How do I filter for a null value?

I’m trying to count the records where the NCMR.Disposition field is null, or empty.

Thanks.

Jeff

=Count( Distinct {<[NCMR.Statuss]-={'Closed'},

[ComplaintMDR.TaskID]={'INJ-RES-A'},

[NCMR.Disposition] = {},

[NCMR.Age (Days)] = {'<30'}
>}

[NCMR.NCMR No])

Gysbert_Wassenaar

That can be tricky. The best solution is to replace nulls and empty values with a real value, i.e. 'N/A', in the script:

Load ...some fields..., if(len(trim(NCMR.Disposition))=0,'N/A',NCMR.Disposition) as NCMR.Disposition

From ...

The set modifier will then be a simple [NCMR.Disposition]={'N/A'}. If you can't or won't fix this in the script you can try [NCMR.Disposition] =- {'*'} or [NCMR.Disposition] = {'=len(trim(NCMR.Disposition]))=0'}


talk is cheap, supply exceeds demand