Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

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

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;

Highlighted
Contributor
Contributor

Thank you Sunny!

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

Mauro