Options

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

cdapontecdaponte Member Posts: 29 Maven
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!

Best Answers

Answers

  • Options
    sgenzersgenzer Administrator, Moderator, Employee, RapidMiner Certified Analyst, Community Manager, Member, University Professor, PM Moderator Posts: 2,959 Community Manager
    hi @cdaponte yes you can use || for OR and && for AND

    Scott
  • Options
    cdapontecdaponte Member Posts: 29 Maven
    Yes! But it doesn´t work for me, i don´t know why. Maybe because one attribute that i use in the if is an attribute that i create before?
  • Options
    varunm1varunm1 Moderator, Member Posts: 1,207 Unicorn
    edited July 2019
    @cdaponte do you mean, you are creating an attribute in the generate attribute and using it in the same generate attribute operator?

    Can you provide your XML code for this process? It is available in XML window (View --> Show Panel --> XML)
    Regards,
    Varun
    https://www.varunmandalapu.com/

    Be Safe. Follow precautions and Maintain Social Distancing

  • Options
    cdapontecdaponte Member Posts: 29 Maven
    if(contains(Tercerizado,"WEISFELD"),"ESTUDIO JUDICIAL",
    if(contains(Tercerizado,"QUIEBRA"),"ESTUDIO JUDICIAL",
    if(contains(Tercerizado,"Weisfeld"),"ESTUDIO JUDICIAL",
    if(contains(Tercerizado,"LLECI"),"ESTUDIO JUDICIAL",
    if(contains(Tercerizado,"SAGUES"),"ESTUDIO JUDICIAL",
    if(contains(Tercerizado,"HADADD"),"ESTUDIO JUDICIAL",
    if(equals(Tercerizado,"JUDICIAL"),"ESTUDIO JUDICIAL", 
    if((Tercerizado=="MORA TARDIA") && ("Producto Genérico"== "CBU- NO BARRIDO"),"MORA TARDIA-CBU-NO BARRIDO",
    if((Tercerizado=="MORA TARDIA") && ("Producto Genérico"=="PV"), "MORA TARDIA-PV","ESTUDIO EXTRAJUDICIAL")))))))))

    It appears that the expression is correct, but the results are not the expected, the 2 last if does not work. "Producto Genérico" is an attribute that i previously created. 
Sign In or Register to comment.