Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
phcaptjim
Creator
Creator

Optomize select in field using AGGR and triggers?

I have an application where the user can enter the minimum number of admissions per patient and based on a variable and trigger, the app will select the patient ID's that meet the criteria.  Once the variable is set, a variable trigger is executed to select patients.  Here is the expression that does the selection using the select in field action:

='(' & Concat({<[Patient ID]=>}if(aggr(sum({<[Patient ID]=>} Admission_Flag),[Patient ID])>= v_Admissions, [Patient ID]), '|') & ')'

v_Admissions is the variable that the user is entering.

Is there an easier way to do this selection?  I have about 750k patients in this application and it takes a little bit for this selection to happen.  The aggr must happen on the fly since the user could filter on other dimensions such as payor, location, date, etc.  Any ideas?

Thanks!

1 Solution

Accepted Solutions
marcus_sommer

You could try it without the concat() only with the search-expression as condition:

='=aggr(sum({<[Patient ID]=>} Admission_Flag),[Patient ID])>= v_Admissions'

See also: The Expression Search

- Marcus

View solution in original post

3 Replies
tresesco
MVP
MVP

So, is the issue only with performance that you are guessing because of aggr() ? Try to share a sample qvw with representative data to work on.

marcus_sommer

You could try it without the concat() only with the search-expression as condition:

='=aggr(sum({<[Patient ID]=>} Admission_Flag),[Patient ID])>= v_Admissions'

See also: The Expression Search

- Marcus

phcaptjim
Creator
Creator
Author

Thanks for the replies.  I'm finally getting back to this.

I did two things, first I took the suggestion that Marcus gave for the search-expression and then I created a table in my data model that just has hospital admissions (instead of searching the entire fact table).  With those two changes the selections now occur immediately instead of waiting 4-6 seconds for the selections to be made.  This should really make our users happy.