Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Removing Duplicates after "Subfield"ing a column in qliksense

Hi Guys,

I am currently working on a app. I have loaded data from the excel file. The column had values such as,

column_name

A,S,T

A,D,F

Co

Co,CD,D,F,T

I used this script to get all the values in the column.

Load

     [a1],

     [column_name],

     subfield([column_name],',') as ind_col_values;

But after this i get this column,

ind_col_values

A
S
T

D
F
Co

CD

D

F

T

I get some duplicate values after I subfield it. Can anyone show me a way of how to solve this problem?

1 Solution

Accepted Solutions
Not applicable
Author

Hi Guys,

Tried all of the concepts that you have posted.

But the actual problem was that the data in the excel had a "space" after comma.

So when i subfielded it, i got duplicates such as "A" and " A".

I solved it by using subfield([column_name],', ') and i was able to remove the duplicates.

Thank you for your help guys.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Try :

Load distinct

     *

;

Load

     [a1],

     [column_name],

     subfield([column_name],',') as ind_col_values;

Anonymous
Not applicable
Author

Hi Sankar,

Please can you tell,how did you check the values are duplicated?

Usually we should check in bottom left list box(ColumnName),values will be displayed as per

how its stored in memory, see below right table box.

As two fields are listed in table box,matching columns are repeated,could that be the

reason you feel they are duplicated

Inline.pnge

Regards

Neetha

rustyfishbones
Master II
Master II

You could try with Trim function

Load

     [a1],

     [column_name],

     trim(subfield([column_name],',')) as ind_col_values;

Not applicable
Author

Hi Guys,

Tried all of the concepts that you have posted.

But the actual problem was that the data in the excel had a "space" after comma.

So when i subfielded it, i got duplicates such as "A" and " A".

I solved it by using subfield([column_name],', ') and i was able to remove the duplicates.

Thank you for your help guys.