Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
phcaptjim
Creator
Creator

Optimize AGGR() function inside a trigger

I've got a few variable input boxes that allows the user to filter patients in a healthcare application.

One filter is for # of admissions.  The field Admission_Flag is either 1 or 0, and the variable v_Admissions is the number of admissions entered into the input box.  When a value is entered, this expression is executed and MRN numbers are selected.  This runs slow and I would like to improve the performance.  Any ideas?

='(' & Concat({<[Patient MRN]=,PayorName=,[Payor GL]=,[Payor Level 1]=,[Payor Level 2]=,[Payor Level 3]=>}if(aggr(sum({<[Patient MRN]=,PayorName=,[Payor GL]=,[Payor Level 1]=,[Payor Level 2]=,[Payor Level 3]=>}

Admission_Flag),[Patient MRN])>= v_Admissions, [Patient MRN]), '|') & ')'

Thanks!

12 Replies
phcaptjim
Creator
Creator
Author

I believe it's using the trigger for OnChange instead of OnInput.  The OnChange trigger still has my original AGGR expression.  They both have to changed for the app to function properly.

Thanks!

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi 

Now is working .PFA sample application.

phcaptjim
Creator
Creator
Author

I was able to use that expression in my application and the results were correct.  However, the performance seemed about the same.  I'm not sure if anything can be done to speed up this operation.  The application has to select thousands of MRN #'s when you make an entry in the input box.  Perhaps this is the nature of the beast?

For example, if I filter on a certain visit type, the app needs to select 200k MRN #'s.  I'm not sure how to speed up that operation.  We could aggregate these numbers in the load script, but then we would loose the ability to aggr over a certain period of time.

I appreciate the feedback on this thread. If anyone has other ideas, I would love to hear them.