Skip to main content

Hi,

I have a set of 24 attributes each with a calculation which results in a numeric value. Is there a way to set a conditional statement across all of these in a similar way to how the NullAttributeMapper works?

I want to apply across all 24 attributes "If value <0, then map to 0" but i want to try and avoid 24 individual conditional statements within an AttributeManager.

Thanks,

Jack

This kinda feels like cheating but...

You can use a regex in the NullAttributeMapper:

The second option, "Or If Attribute Value Is:" only seems to accept specific values so this is probably the easiest workaround.


This kinda feels like cheating but...

You can use a regex in the NullAttributeMapper:

The second option, "Or If Attribute Value Is:" only seems to accept specific values so this is probably the easiest workaround.

Don't mind a cheat! Thanks, worked perfectly.


Hi @jacklonsdale, alternatively you can use the ExpressionEvaluator with the Overwrite Existing Attributes mode.

@CurrentAttribute() < 0 ? 0 : @CurrentAttribute()

0684Q00000ArKCSQA3.png


I would use an ExpressionEvaluator after the AttributeManager in Mode Overwrite Existing Attributes with the expression

@CurrentAttribute() < 0 ? 0 : @CurrentAttribute()

and select your 24 attributes to overwrite.


Reply