Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to separate parts of the string, using 'left' and 'index' ?

i have alphanumeric values in a column like this ,

5. very satisfied

4. satisfied

5. very satisfied

4. satisfied

3. neutral

2. dissatisfied

1. very dissatisfied

3. neutral

2. dissatisfied



how to separate numeric and char part in two different columns using 'left' and 'index' function ?


Thanks.



1 Solution

Accepted Solutions
giakoum
Partner - Master II
Partner - Master II

a small improvement. If you add the space in the delimiter, you can omit trim :

subfield('5. very satisfied','. ',1)

subfield('5. very satisfied','. ',2)

View solution in original post

9 Replies
florentina_doga
Partner - Creator III
Partner - Creator III

=subfield(5. very satisfied,'.',1) !

florentina_doga
Partner - Creator III
Partner - Creator III

=subfield('5. very satisfied','.',1)

Anonymous
Not applicable
Author

Or use the subfield() function.

     =trim(subfield('5. very satisfied',.,1))

     =trim(subfield('5. very satisfied',.,2))

giakoum
Partner - Master II
Partner - Master II

a small improvement. If you add the space in the delimiter, you can omit trim :

subfield('5. very satisfied','. ',1)

subfield('5. very satisfied','. ',2)

buzzy996
Master II
Master II

ya,subfield() is the right function here!

ankit777
Specialist
Specialist

hi

try like this

for numeric part

=left(fieldname,1)

for string

=SubField(fieldname,' ',2)

Not applicable
Author

Thanks All

vishsaggi
Champion III
Champion III

Hey Ajinkya,

Just another way using Left() and Right() functions.

Number: = Left(StatusName, 3)

Text:      = Right(Status, Len(Status) - Len(Left(Status,3)))

Thanks,
V.

Not applicable
Author

The use of index is then also possible :

Number: = Left(StatusName, INDEX(StatusName, '.') - 1)

But subfield is a better solution!