Calculation element issue

Status
Not open for further replies.

s6930064

Member
Hi,
In case we have a calc element (# in image) with option ?Only Calc on Save=no?, displayed in a list and the list has display mode ?Merge rows? or ?Merge rows and reduce data? for a join column (date in image) then the code in calc element will run as many times as the unmerged data.
Untitled.png

So in my image example the code I have in # it will run 2 times and not one.

This behavior creates an overhead in the list display process as any code (simple or complex) in calc elements will run many times but only the result from the last run will be displayed in the list.
 
That's unavoidable. The "merging" is only done after all the elements have been selected and rendered. And if you think about it, we have no way of knowing that your calc is going to produce the same result for each instance of the repeat, as you could be doing absolutely anything in that code, like generating random strings, so we can't make any assumptions about when we do and don't have to calc repeats.

You only option is to use "Only cacl on save" as "Yes", so the calc isn't run when rendering in list view. But of course whether you can do that or not depends entirely on what your calc does - hence why that option exists, as some calcs it makes no sense to run when rendering, only when saving, so you can save the overhead ... but some do need to be run on rendering (like if they rely on data outside of their own row which could have changed since being saved).

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top