Calculated attribute

0
I need to create a calculated attribute and i have to use some more attributes of the same entity to calculate it. I have to put the value in the attributes that I need to have to calculate the calculated attribute before I had the calculated attribute but when I use the debugger I can see that the calculated attributed is calculated before I put some values on the other attributes, but I don’t know how to calculate the value after i write the other values.
asked
4 answers
2

So based on your screenshot, put an on-change nanoflow on each of the fields that need to be changed to get to a calculation:

 

answered
2

First, it would help if we knew your use case. In many cases, rather than using a calculated attribute, you'll want to calculate an attribute “manually” (that is, in a microflow or nanoflow) when something is changed. Especially having various calculated attributes can impact your performance.

 

You can read a bit more about the best practices with regards to calculated attributes here in the documentation:

Performance Best Practices

Could you share a bit more about your use case?

answered
1

Hi Alvaro

Via this URL: https://docs.mendix.com/refguide/performance-best-practices#calculated-attribute-on-page you can follow these steps (2.1.1 Steps to Fix) in order to keep it a lot more simple and avoid performance issues. In a lot of cases, the calculated attribute is not needed. It’s very much handy when the calculation happens in the background, but if it’s to display it in a page (as in your case), you better use the steps documented in the URL I provided.

Hope this fixes your problem.

Kind regards,

Leander

answered
0

I need to calculate Tiempo total ejecucion after Calendario,, Volumen transacciones, tiempo ejecucionx transaccion and num usuarios will not be empty

answered