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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to remove duplicate text in a field?

Hi,

I have a text field where every row contains many product codes. One row might look like below (data is separated by ','):

12y,14c,23k,24t,12y

My problem is that many rows might contain duplicate (or more) product codes. From above example, product code 12y appear twice.

How can I automatically remove alla duplicate instances so that only one distinct product code remains on every row? In above example, 12y would have been removed automatically either from the end or the start.

Thanks in advance,
Thomas

1 Solution

Accepted Solutions
biester
Specialist
Specialist

Generally I think that using DISTINCT in combination with SUBFIELD() could solve the problem. But actually I'd deem it impudent to give more detailled advice without knowing more details.

Regards,
Joachim

View solution in original post

3 Replies
biester
Specialist
Specialist

Generally I think that using DISTINCT in combination with SUBFIELD() could solve the problem. But actually I'd deem it impudent to give more detailled advice without knowing more details.

Regards,
Joachim

Anonymous
Not applicable
Author

Yes, if do it in the script, it will be cutting in pieces by subfield, and on the next step concatenating by concat(distinct ...)

Not applicable
Author

Thanks Joachim, that did the trick! 🙂