Skip to main content
Question

STRING_SPLIT or EXPLODE() for comma separated Array

  • April 10, 2026
  • 1 reply
  • 33 views

leonardo.spina
Level 6
Forum|alt.badge.img+1

Hi all,

 

I have a column with multiple values   e.g. col_list = '21651,5615561,50615,561591' per case_key

I need to split the values in four different rows when showing an OLAP table in studio.

Some  case_keys present up to 5000 values in that column.

 

Thank you for your help,

 

Leonardo

1 reply

janpeter.van.d
Level 12
Forum|alt.badge.img+26

Hi ​@leonardo.spina

This is unfortunately not possible in plain PQL, since there is no iteration option. 

The hard-coded option (also for future reference for other peers here) would be:

  • Using STRING_SPLIT to split your string
  • Using UNION_ALL to plot it over different rows. 

The code for your example (with 4 fields) would be something like this: 

UNION_ALL(

    STRING_SPLIT(“<table_field>”, ‘, ‘ , 1), 

    …..

    STRING_SPLIT(“<table_field>”, ‘, ‘ , 4)
)

This is not scalable to up to 5000 field references, so in that case I would advice to use Python in the Machine Learning Workbench to iterate over all values and create a new table.