How can i do an if that must meet two conditions, if there is no "and" function?
Find more posts tagged with
Sort by:
1 - 6 of
61
@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)
Can you provide your XML code for this process? It is available in XML window (View --> Show Panel --> XML)
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.
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.
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.
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.
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
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
Sort by:
1 - 2 of
21
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.
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.
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
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
Scott