How can i do an if that must meet two conditions, if there is no "and" function?

User: "cdaponte"
New Altair Community Member
Updated by Jocelyn
I´m using the operator Generate Attributes and i want to generate an attribute from 2 existing ones, and the problem is that i have to use an if expression but it must meet two conditions. As far as i´m concerned there is not a function like "AND" o yes?  

Thank you!

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "varunm1"
    New Altair Community Member
    Accepted Answer
    Updated by varunm1
    Is the attribute type of "Tercerizado"  text? I see that "contains" only works for attribute type Text. If it is polynomial, you can use nominal to text operator to convert the attribute type to text. Also the text in quotations is case sensitive. 

    I tried && operator with a new attribute created and it works fine for me. If it still doesn't work, try creating "producto Generico" in generate attribute and then again use another generate attribute to create this "if" based column after producto generico. Test and see how it goes.
    User: "tftemme"
    New Altair Community Member
    Accepted Answer
    Hi @cdaponte

    The problem with the second conditions in the last 2 if conditions is, that you have put the Producto Genérico into "". So RapidMiner takes "Producto Genérico) as a normal String (and not using it as the attribute) and compare it to the other String ("PV"). This obviously results always in false. So although the syntax of the expression is correct (thats the only thing RM can check), the condition will never be fulfilled. 

    Just change "Producto Genérico" to [Producto Genérico] and your if conditions should work.

    Best regards,
    Fabian