Extract all sublists with size n of list created by GROUPCONCAT

Comments

3 comments

  • Pablo Redondo

    HI Tim,

    I would use the ngram function. It takes in a list value (the result of your concat) and the n value (3).  ngram(<your concat list>;3).

    Hope this helps.

    Pablo

    0
    Comment actions Permalink
  • Tim

    Hi Pablo,

    thanks for the suggestions, but the NGRAM function doesn't return a list but the elements of the input list concatenated.

    What I need is all subLISTS with size n so that I can process them further. The problem is, that my input list elements contain text with spaces so that I can't split them after the NGRAM function concatenated them.

    Best regards,

    Tim

    0
    Comment actions Permalink
  • Tim

    I solved it now by embedding a delimiter character (with CONCAT) in the list elements before GROUPCONCATing the elements. After that I can go for NGRAM and apply TOKENIZELIST on the resulting column using my delimiter I've set before and then get my desired list with size n.

    Best regards,

    Tim

    0
    Comment actions Permalink

Please sign in to leave a comment.