Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

string function index space

Hi,

Quick question, I have a field within a table with a list of values as such:

500 100

600 200

800 100

20 30

10000 20000

50000 60000

2 3

I need to use a string function to only give me the numbers on the right of the space ' ' so that I end up with the following:

100

200

100

30

20000

60000

3

Can anyone help?

Thanks,

Nikki


1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

=SubField(Fieldname,' ',-1)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

8 Replies
MayilVahanan

Hi

Try like this

=SubField(Fieldname,' ',-1)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

You can use subfield to get the required number.

Subfield is looking for the second value found and delimiter is a space:

Test:

LOAD * INLINE [

Numbers,

500 100,

600 200,

800 100,

20 30,

10000 20000,

50000 60000,

2 3

];

[Final]:

LOAD SubField(Numbers,' ',2) as Number

RESIDENT Test;

DROP Table Test;

Clever_Anjos
Employee
Employee

subfield(yourfield,' ',2)

tresesco
MVP
MVP

Use Subfield() function, like:

Load

        SubField(YourField, ' ', 2) as CorrectedValue

from <>;

rajeshvaswani77
Specialist III
Specialist III

Hi Nikki,

Somthign likethat would do.

 

=mid('500 100',index('500 100',' '))

IT returns 100 for me

thanks,

Rajesh Vaswani

israrkhan
Specialist II
Specialist II

Hi,

Try below in Script Load:

=Right( YourFieldName, index( YourFieldName,'  ') -1 ) as GiveFieldName

Hope to help.

Khan

Anonymous
Not applicable
Author

Hai Try it....

Table1:

LOAD * INLINE [

    F1

    12 313

    123 33

    23232 33

    233 33

];

Table2:

load

subfield(F1, Chr(32) ,1) as F1

Resident Tab1;

Drop Table Table1;

Hope this helpful..

quiquegzz
Partner - Contributor III
Partner - Contributor III

Hi.  Nikki.

TABLE_1;

LOAD * INLINE [
F1
500 100
600 200
800 100
20 30
10000 20000
50000 60000
2 3
]
;

RESULT:
LOAD 
MID(F1, index(F1,' ',1),Len(F1)) AS FIELD 
RESIDENT TABLE_1;

DROP TABLE TABLE_1;