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: 
cbaqir
Specialist II
Specialist II

Set Analysis Syntax - For subgroup A, how many also have B?

I have a text box that says how many tickets were Opened within the last 3 months and it works:

=Count({$<DEFECT_ID *= {"=Min({1}DETECT_DATE) >= AddMonths(Today(),-3)"}>}DISTINCT DEFECT_ID)

I am trying to come up with the right syntax to show of the tickets opened within the last 3 months, what was the avg days between two steps but I can't get it combined correctly:

=num(avg(aggr(date(min( {$<ADJ_GOVERNANCE_PHASE_SUMMARY={'2.1*'} >} ADJ_GOVERNANCE_PHASE_START_DATE),'MM/DD/YYYY')-
date(min( {$<ADJ_GOVERNANCE_PHASE_SUMMARY={'1.1*'} >} ADJ_GOVERNANCE_PHASE_START_DATE),'MM/DD/YYYY'),DEFECT_ID)),'#0')

TIA! 

1 Solution

Accepted Solutions
Nicole-Smith

You should just be able to add the set analysis from the first into the second:

=num(avg(aggr(date(min( {$<ADJ_GOVERNANCE_PHASE_SUMMARY={'2.1*'}, DEFECT_ID *= {"=Min({1}DETECT_DATE) >= AddMonths(Today(),-3)"}>} ADJ_GOVERNANCE_PHASE_START_DATE),'MM/DD/YYYY')-
date(min( {$<ADJ_GOVERNANCE_PHASE_SUMMARY={'1.1*'}, DEFECT_ID *= {"=Min({1}DETECT_DATE) >= AddMonths(Today(),-3)"}>} ADJ_GOVERNANCE_PHASE_START_DATE),'MM/DD/YYYY'),DEFECT_ID)),'#0')

View solution in original post

1 Reply
Nicole-Smith

You should just be able to add the set analysis from the first into the second:

=num(avg(aggr(date(min( {$<ADJ_GOVERNANCE_PHASE_SUMMARY={'2.1*'}, DEFECT_ID *= {"=Min({1}DETECT_DATE) >= AddMonths(Today(),-3)"}>} ADJ_GOVERNANCE_PHASE_START_DATE),'MM/DD/YYYY')-
date(min( {$<ADJ_GOVERNANCE_PHASE_SUMMARY={'1.1*'}, DEFECT_ID *= {"=Min({1}DETECT_DATE) >= AddMonths(Today(),-3)"}>} ADJ_GOVERNANCE_PHASE_START_DATE),'MM/DD/YYYY'),DEFECT_ID)),'#0')