Property Calculator, parenthesis doesn't work with operations

I was creating a property calculation to sum all properties from related objects, that works but the total represent only the 80% and after the sum of relatives I need to add manually the 20% this is just becaus an intenal procedure and needs to be like that.

the property is "MC_Ponderado Total"

I was trying this in the operation giving me the result of 80, that is correct for the sum of relatives

{Actividades.ForEach()]+{Ponderacion}

this work to sum all Ponderation values from all relatives that should count 80 because the procedure, but to the total I need to add 20 to complete the 100% needed to be viewed in the metadata card.

I've tried this but does not work giving a null result

({Actividades.ForEach()]+{Ponderacion})+20

Trying This without parenthesis

{Actividades.ForEach()]+{Ponderacion}+20

Add 20 to each relative making a sum grater than 100%

How could this be solved?

Parents
  • Hi,

    Parenthesis does not work, because problem is not related to calculation itself, but foreach functionality and how it build string that is counted. Foreach makes rest of the sentence loop for every single "Actividades". Because of that +20 is added for every "Actividades" object, and parenthesis has no effect for that.

    There is couple ways to fix this:

    1. Set fixed part before the loop:

    "20{actividades.foreach()}+..."

    2. Add 20 separately:

    There can be another rule below this, that will add 20 to end result:

    There is also "Next()" placeholder which ends looping in selected point. At least earlier it had some side effects and Property Calculator did not support it. I am not sure what is current situation.

  • Way number one is not clear to me, just putting 20 before parenthesis adds 20 to the total of related objects?

    Way number two why grouping level? I tried this way and looks to be working, is ok for you?

Reply Children
No Data