Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Performance optimization of Expression

Hello All,

In my app I am selecting Prescriber using the below expression in a list box and on Map.

This is a trigger condition on a button :

=concat(aggr(if(sum(Volume)>20, only(Prescriber)),Prescriber),'|','')

However, the selection is taking more than a minute if number of prescribers is high(e.g >10000)

Any idea how we can optimize above scenario?

Thanks

Khushboo

6 Replies
sunny_talwar

Is this needed to be aggregated on the front end (in other words does this need to work with selections)? If it doesn't then may be pre-aggregate this in the script and then create a flag for each Precriber and then select the flag field...

Not applicable
Author

Hi Sunny,

This needs to be aggregated on the front end.

sum(Volume)>20, is user input field. User may select some other metric or combination of metrics.

Hence,  this cannot be calculated from script side.

Regards

Khushboo

tresesco
MVP
MVP

Try this:

='(' & concat(Distinct {<Prescriber={"=sum(Volume)>20"}>} Prescriber ,'|')  &')'


Edit: corrected a bracket.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I feel you dont need any trigger.

All you do if add a filter i.e Prescriber  and ask your user to search on that field as =sum(Volume)>20

it will do the relevant selection.


give it a try.


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Thanks Trsesco for the solution.

Now in my actual implementation,sum(Volume)>20 is something which the user is selecting on the fly.


This is coming from a var: vExp


='(' & concat(Distinct {<Prescriber={"=vExp"}>} Prescriber ,'|')  &')'


When i try this prescribers are coming as blank.


Am i doing anything wrong in above expression. Is there anyway to correct the same.







tresesco
MVP
MVP

Try with $ expansion like:

='(' & concat(Distinct {<Prescriber={"=$(vExp)"}>} Prescriber ,'|')  &')'