cancel
Showing results for 
Search instead for 
Did you mean: 

stringif not properly working with and, or, &&, || comparison connectors

Former Member
0 Kudos

Hi

Im migrating from  xmii 11.5 to mii 12.2, and we are facing that this class of sentences is not working properly in MII, but it was working perfect in XMII

stringif(Repeater.Output{/Row/dbInd} !="" and Repeater.Output{/Row/dbInd} != "NA" and Repeater.Output{/Row/dbInd} != nullstring, Local.DBInd  & Repeater.Output{/Row/dbInd}  & "," , Local.DBInd)

I tried using another || or &&, and we have the same problem

stringif(Repeater.Output{/Row/dbInd} !="" || Repeater.Output{/Row/dbInd} != "NA" and Repeater.Output{/Row/dbInd} || nullstring, Local.DBInd  & Repeater.Output{/Row/dbInd}  & "," , Local.DBInd)

The problem is that whenever you put "and, or, ||, &&", the conditional does not work fine. and the result is always true.

I even use this for testing purposes

stringif("A" == "A" && "B" == "B", " FALSE", "TRUE");

stringif("A" == "A" and "B" == "B", "FALSE", "TRUE");

stringif("A" == "A" or "B" == "B", "FALSE", "TRUE");

stringif("A" == "A" || "B" == "B", "FALSE", "TRUE");

All the results are always "FALSE" , that is incorrect. Can you help me with this? I have a lot of transactions using this kind of sentences and Im soon to go live. I hope somebody answer me today before send this to an OSS

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

suhas_nagaraju
Participant
0 Kudos

Hi Fernando,

     First thing I found is that the stringif function parameters are like this 'stringif(condition, onTrue, onFalse)'.

I even use this for testing purposes

stringif("A" == "A" && "B" == "B", " FALSE", "TRUE");

stringif("A" == "A" and "B" == "B", "FALSE", "TRUE");

stringif("A" == "A" or "B" == "B", "FALSE", "TRUE");

stringif("A" == "A" || "B" == "B", "FALSE", "TRUE");

So for the above 4 examples you have written the onTrue parameter as 'FALSE' hence everything is returning false.

     Second point is whenever you use '&&' or '||' please use the expressions within brackets.

Example: stringif(("A" == "A") && ("B" == "B"), <condition for onTrue>,<condition for onFalse>);

Thanks,

Suhas