Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
Contributor II

Getting the total for 1st and 2nd filter values

Hi All!

I have a metric in a text box called, <5 days and a filter called Close Bucket with ff values: 24 hrs, 1-3 days, 4-5 days, 6-10 Days.

I'm using  set analysis as follows:

=Num(if(len([Close Bucket])>1,(vLess5ToClose), if(len([Close Bucket])<1,vLess5, '0')),'#,##0')

 vLess5ToClose  as:

= If(
(Num(Count({$<[Close Bucket]= {'24 hour'}>} Distinct [ID])
+Count({$<[Close Bucket]= {'1-3 Days'>} Distinct [ID])
+Count({$<[Close Bucket]= {'4-5 Days'>} Distinct [ID]),'#,##0')),

If((
  if(len([Close Bucket] ='6-10 Days') >1,1,0)
       )>=1,'0', count(Distinct[ID])))

 vLess5 as:

=If((if(len([Close Bucket] ='1-3 Days') >1,1,0) +
    if(len([Close Bucket] ='4-5 Days') >1,1,0) +
    if(len([Close Bucket] ='6-10 Days') >1,1,0)
       )>=1,'<N/A>',
Num(Count({$<[Close Bucket]= {'24 hrs'>} Distinct [ID])
+Count({$<[Close Bucket]= {'1-3 Days'>} Distinct [ID])
+Count({$<[Close Bucket]= {'4-5 Days'>} Distinct [ID]),'#,##0'))

 

My expression is giving me the result expected except that when I’m selecting just the values, 24 hrs and 1-3 days, it’s still giving me the total for the <5 days (which is the total of 24 hrs, 1-3 days and 4-5 days).  What should be the correct set analysis for this?