Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Subfield

Hi everyone,

Recently I was working with the function subfield and I had some minor problems.

I had a table with countries and IDs and some countries had multiple IDs, so I used subfield to extract and associate one ID per country.

Now, it happened that the function created a new column next to the IDs (IDs 2, let's say) in which the "second" IDs are contained, but the number of rows it's still the same.

I would like to maintain one column of IDs and ideally "duplicate" the row, with all the info associated to the ID.

In previous examples that I saw on the community the "duplication" was automatic, but that is not my case, do you have any suggestions?

This is the code that I wrote:

Load distinct,

Countries,

ID

Product

Comment

subfield("ID", ',', 2) as UnID

resident PROD2018;

drop table PROD2018;

rename Table PROD2018temp to PROD2018;

Thank you in advance,

Mauro

2 Replies
sunny_talwar

Try by removing the 2 from your SubField function

SubField("ID", ',', 2) as UnID

Load distinct,

Countries,

ID

Product

Comment

subfield("ID", ',') as UnID

resident PROD2018;

drop table PROD2018;

rename Table PROD2018temp to PROD2018;

Anonymous
Not applicable
Author

Thank you Sunny!

I will try and I will let you know if this works.

Mauro