🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

"Loop Attributes - Expression Evaluation Error"

User: "1705410G"
New Altair Community Member
Updated by Jocelyn
I'm using 2 separate Loop Attributes Operator, each containing a Generate Attribute Operator.

Attribute Name(Inside Generate Attribute) for both Loop Attributes Operator: %{loop_attribute}


However, this error popped out. 
Expression Evaluation Error: The function 'eval' failed to parse the subexpression '203_10'. Cause: token recognition error at '_'  .
Initially, I thought that by removing the underscore '_' will solve it. But no matter what I did to rename it using the Rename by Replacing operator, it doesn't work. Same error comes up.



Sometimes, the Not Enough Iterations Error  pops up as well. I'm confused when I have set the Loop Attribute to subset and have selected the necessary attributes. 

Regards,
AY

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "David_A"
    New Altair Community Member
    Accepted Answer
    Hi,

    the problem here is how macros are parsed.
    In your case, first %{loop_attribute} is replaced with the attribute name, this is "2_speed". Then the eval() function tries to make sense of that string as a number or mathematical expression, what fails.

    In that case you need to use the seldom used #{loot_attribute} syntax. This returns the value corresponding to that attribute name.

    @mschmitz has described it nicely in this posting:
    https://community.rapidminer.com/discussion/50538/how-to-use-macros

    And congratulations, you are now in the higher echelons of macro handling  ;)

    Best,
    David

    User: "lionelderkrikor"
    New Altair Community Member
    Accepted Answer
    Hi @1705410G,

    Can you try to define attribute name as %{loop_attribute} (or something like %{loop_attribute}_bis if you don't want that your initial attributes are removed) instead of #{loop_attribute} :  



    Hope it helps,

    Regards,

    Lionel