Skip to main content
Inspiring
Jan 21, 2019 7:03 PM UTC
Answered

Combine a query of strings and then search

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 is closed to new replies. Start a new post to keep the conversation going.
    BKBK
    BKBKCorrect answer
    Community Expert
    Jan 21, 2019 7:42 PM UTC

    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");

    }

    3 replies

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    Jan 21, 2019 7:42 PM UTC

    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");

    }

    Translate
    weezerboyAuthor
    Inspiring
    Jan 21, 2019 8:08 PM UTC

    As always - thank you

    Translate
    BKBK
    Community Expert
    Community Expert
    Jan 21, 2019 8:26 PM UTC

    My pleasure, weezerboy​

    Translate