The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Can I pass macro in extract macro

sgnarkhede2016sgnarkhede2016 Member Posts: 152 Contributor II
edited August 2020 in Help
Hello,

I want to pass attribute name dynamically as loop iteration like in 1st iteration in "attribute name" is "attribute_1" in second "attribute_2" and so on.

when i checked in generate attribute this macro gives correct result what i want "SCENARIOPARAMETER_"+%{iteration}" but same when i passed in extract macro giving error " attribute not present in input data" and hardcoded workling
Tagged:

Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data Scientist
    Hi,
    i guess you want to use the attribute function. to access the value of attribute_%{iteration} you usually do

    attribute("attribute_"+%{iteration})
    There are some more things you can do with the # notation instead of %, but i always forget them and need to ask @David_A

    Best,
    Martin
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • David_ADavid_A Administrator, Moderator, Employee-RapidMiner, RMResearcher, Member Posts: 297 RM Research
    Hi,

    the attribute() function is exactly the thing you're looking for. It will resolve the macro value first and and then looks the combined string as an attribute name.  With the # you could basically do the same, but the function is the more readable approach.

    Best,
    David
Sign In or Register to comment.