Splitting tilda seperated text into columns

Hello,

Right now we have 3 plants, Soon we will add 4 others when we go live. Not all users have access to all the plants. So I am trying to create a BAQ I will use in my dashboards to allow to switch plants when viewing data. But I only want to show in the selection list, the plants allowed to the current user.

I found a function called STRING_SPLIT. I used it in MSSQL as this: which the result would be the list of the allowed plants to the user
image

How do I implement such functionality? I tried directly to use the function and it did not recongnized it.

Given the current user, and current company, only list the plants in PlantList field.

thank you
Pierre

Here’s a hack of a solution (maybe a better one further down in the topic)