Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Splitting a field name

Hi all,

I am having an issue with loading a field name as two separate fields.

Basically, the field name 'Version' is made up of two strings separated by a space. The length and format of both strings can differ and in terms of length and character composition (mix of numbers and letters).

I have tried to use the Trim and Left/Right functions to split Version into two different fields Version_Type and Version_Number taking the two strings, but because the number of characters differ in each item I can't apply a consistent rule.

The fields appears like this:

Version
DWSZPL X425
LTRB 31JK89
WSRTBBX 90D2Y
JTM PW8

I need to cut them at the space and load them as follows:

Version TypeVersion Number
DWSZPLX425
LTRB31JK89
WSRTBBX90D2Y
JTMPW8

Any suggestions on the best way to do this?

Thanks in advance.

12 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You don't like the mid() and left() functions? They do work though...

Anonymous
Not applicable
Author

Sorry, I don't think it works as requested.

This (for Version Type)

subfield('AAA BBB CCC', ' ', SubStringCount('AAA BBB CCC', ' '))

returns 'BBB' instead of expected 'AAA BBB'

Not applicable
Author

subfield(Version, ' ', SubStringCount(Version, ' ')) as [Version Type]

subfield(Version, ' ', SubStringCount(Version, ' ')+1)  as [Version Number]