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: 
ameliag
Contributor
Contributor

Separating single column into multiple columns based on value(s)

Hi,  I'm looking at dividing a single column with values 2 and 3 (category ids) into two separate columns these are joined by a part id. So the columns I would want are Category_id_2, Category_id_3 & Part_id. I have been able to create two separate files with Category_id_2 & Part_id and another with Category_id_3 & Part_id however I cannot figure out how to join them into one!

Would anyone be able to assist?

 

Thanks,

Amelia

 

Labels (1)
  • v8.x

4 Replies
BrunPierre
Partner - Master II
Partner - Master II

Provide data sample and the anticipated result.

quentin-vigne
Partner - Creator II
Partner - Creator II

Hi ameliag,

 

Could you provide a sample of your data so that we know how the separation take place ?

In the meantime, you could look into tExtractDelimitedField which is a component that split a column into multiple columns if you give it a separator

https://help.talend.com/en-US/components/8.0/processing/textractdelimitedfields#:~:text=Generates%20....

SterreKapteijns
Partner Ambassador
Partner Ambassador

Hi Amelia, 

For me it is not entirely clear what you mean and how the field is formatted. If for example, the field is formatted as category_id_2 - part_id - category_id_3, you could retrieve the fields with left(), right(), substring() or index() to get the index of the '-' character. 

Tyrone2556
Contributor
Contributor

Hi Amelia, if your field has a delimiter perhaps you could use the subfield function? I am not entirely sure what you mean, can you give us an example?

 

https://help.qlik.com/en-US/sense/May2024/Subsystems/Hub/Content/Sense_Hub/Scripting/StringFunctions...