Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Subfield question

In our manufacturing system under sales orders it records the customer sales reps in a single field separated by ~.

We want to add a selection so that the user can select a single sales rep and return the orders that they are on. I have tried using subfield(salesreplist,'~') but this is not working 100%. Does anyone know the best way to split this field into a single list?

4 Replies
swuehl
MVP
MVP

Why it is not working 100%? Could you give some sample data and what you expect?

Miguel_Angel_Baeyens

Hi,

If you mean you are using it as an expression into a listbox, I'd rather create the field in the script, even using SubField() with a third parameter as the value in the script you would like to extract, i. e:

=SubField('John~Peter~Mike', '~', 3)

Should return "Mike"

Hope that helps.

Miguel

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I would create a table in the load script containing the sales order # and rep name, using subfield in the way you attempted

LOAD salesorderID as [Order ID],

          SubField(salesreplist, '~') As [Sales Rep]

Resident SALESORDER;

Then Sales Rep is linked to the sales orders for that rep.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

It seems that is was just having issues when I was calculating it in a list box. I moved the expression to the script and it seems to work fine.

The issue was that it was returning orders without the currernt selection and other things.