Skip to main content
Inspiring
January 21, 2019
Answered

Combine a query of strings and then search

  • January 21, 2019
  • 1 reply
  • 833 views

I have a query that returns results like this

Row 1 -C,HU,NU,PO, CY, CAB

Row 2 - A,AB,AB,ABC,TY,GYU 

So I need to combine these results into one string and then see if the string 'CAB' is in the new combined string.

If it is, then output Yes

How do I do this easily?

    This topic has been closed for replies.
    Correct answer BKBK

    weezerboy  wrote

    So I need to combine these results into one string.

    // Combine comma-delimited list

    combinedList=listAppend(list1,string2);

    ... see if the string 'CAB' is in the new combined string.

    If it is, then output Yes

    if (listFindNoCase(combinedList, "CAB") gt 0) {

       writeoutput("Yes");

    }

    1 reply

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    January 21, 2019

    weezerboy  wrote

    So I need to combine these results into one string.

    // Combine comma-delimited list

    combinedList=listAppend(list1,string2);

    ... see if the string 'CAB' is in the new combined string.

    If it is, then output Yes

    if (listFindNoCase(combinedList, "CAB") gt 0) {

       writeoutput("Yes");

    }

    weezerboyAuthor
    Inspiring
    January 21, 2019

    As always - thank you

    BKBK
    Community Expert
    Community Expert
    January 21, 2019

    My pleasure, weezerboy