Column Expressions IN Operator

Hi friends

Does anyone knows how I can use the “IN” operator in the “Column Expressions” node?

For example:

I usually create a lot of Else conditions “Else IF”, for the same results.
But, if I create only one Else IF using de IN operator (similar to SQL)

=

IF
.......
else if (left(column("Texto cabeçalho documento"),2) == "FR")
    {
        "SemConfronto_Msaf_FreteFatura"
    }

else if (left(column("Texto cabeçalho documento"),2) == "OE")
    {
        "SemConfronto_Msaf_FreteFatura"
    }

=

Like this Below


else if (left(column(“Texto cabeçalho documento”),2) $ FR_OE)
{
“SemConfronto_Msaf_FreteFatura”
}

In some programming languages, the IN operator seams to be this sign “$” , and the list of items separated by underline.

How would it be inside “Column Expressions” node?

You can try array functions like arrayContains()

Hi Friend

Do you know how the code would it be?


if (left(column("StringColumn"),2) == "OE")
    {
        "ComConfronto_Msaf"
    }
  else if (left(column("StringColumn"),2) == "EU")
      {
          "ComConfronto_Msaf"
      }

I tried to google it, but not find any examples.

See discussion here

1 Like

I even thought that I would have to use a variable to store the list.
Maybe something like this:

var list = {“OE”, “EU”}

if (left(column(“String Column”),2) == list)
{
“SemConfronto_Msaf_FreteFatura”
}

Hi friend,
it worked.

I saw your link post from another question and that clarify my thoughts.
I create a “varible” array at the top of the code

image

Then, down to the code I used the array

image

Thank you for the Help.

I learned one more.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.