Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have to create a whole app that is going to calculate something when a field selection is A and something else when the field selection is B.
Which is better solution from performance scope?
1. Create one expression to every single object that use this logic if(GetSelectedCount(FieldA])>0 , sum(FieldB), sum(FieldC))
2. Or else create two separate expressions with condition on expession?
Keep in mind that I have to do that on every single object in the app and there are really a lot of objects (which are using conditional show on object).
Pleased for your advise,
Helen
How about doing this condition in the script.
It has to be working dynamically and be responsive to the selections...
Conditional expression would perform best, but as you hinted, may be difficult to maintain with a lot of objects.
Using a variable to select the expression will give you both performance and maintainability. Define a variable "mycalc" as follows:
=if(GetSelectedCount(FieldA])>0 , 'sum(FieldB)', 'sum(FieldC)')
Note the equal sign and he quotes around the expressions.
Then code the chart expression as:
$(mycalc)
-Rob
A dynamic expression directly via a table and a link to the selection field:
Thank you all guys,
I will testyour suggestions out and I will let you know.
Note that Petter's solution has one additional advantage that others may not have: you can make your Expression list configurable using an external file (e.g. an Excel file)
BTW Thanks Petter, the INLINE delimiter trick is something new I learned from your script.