Calculation using Microflow

0
The formula is Z = A + B1 + B2 + (C1*C2*...).   What I am currently doing now is that to allow the formula to calculate the empty value. For example; If I indicate all the respective values except for Value A, the calculation using whatever values that has been added should provide the Value for A.   Please assist me with this! Thank you!
asked
1 answers
0

Hi there,

Assuming only one value can be empty and 0 is considered empty, I would solve the problem with a microflow looking like this: image.png

 

The loop calculates the value of all C values (from the (C1 * C2*...) in your formula

 image.png

 

Each decision checks if one of the values is empty and rearranges the calculation to calculate the empty value:image.png

 

Alternatively - if you don't want to assume 0 is an empty value, since you're using Mendix 10.16, you can pass in a string parameter when calling the microflow via a button.

However, this would mean you would need a separate button for each value you wish to calculate:

image.png

image.png

 

 

Hope this helps,

Liam

 

answered