🎉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

How to change regular attribute by appending macro and use that attribute for calculation

User: "sgnarkhede2016"
New Altair Community Member
Updated by Jocelyn
Hello,

I have the regular attribute name  "atttribute_W" , the W is coming from my macro and append to  atttribute 
next time regular attribute changes to "atttribute_Y" as per my config macro

When I am using this in generate attribute for calculation I getting error "erroneous expression"
Value_%{macro1}                if (Profile=="High",attribute_%{maco1}*100,
                                             if (Profile=="Medium",attribute_%{maco1}*200,
                                             attribute_%{maco1}*300))



Find more posts tagged with

Sort by:
1 - 4 of 41
    User: "varunm1"
    New Altair Community Member
    Hello @sgnarkhede2016

    Can you provide your process as .rmp file? You can export from rapidminer using File --> Export process and attach it here. Also, did you check if macro names are correct?

    Hi @sgnarkhede2016 if you what to use the value of the macro you need to use eval(%macro_name) and you'll also need to use concatenate if you expect to have macro=10 to obtain attribute_10
    User: "sgnarkhede2016"
    New Altair Community Member
    OP
    Updated by sgnarkhede2016
    It works only for the attribute name "check_%{initial}"  but when used in expression it won't work.
    check_%{initial}   score_%{initial}
    e.g.
    score_%{initial} is already calculated in example set i want to calculate the score on that value but %{initial} changes to W, M,HY(week,Month..) as per iteration.
    I tried Concat but it not working for me
    User: "sgnarkhede2016"
    New Altair Community Member
    OP
    Accepted Answer
    Its work for me before I did not use quotes for attributes names that's why not working
    round(eval("AARPI_TXN_SD_CNT_"+%{initial}))