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: 
Not applicable

Need to get the last 4 digits from unstructured text lines, how?

Hi all,

i got a column with likes that includes both text and numbers:

looks something like that (the text is random here but format/structure is the same though):

Bob Bobinald on the tree, 1234

Oranges, Mike!!!! #palms, 1111

Going on vacation soon, 2222

blah blah... blah, 3333

some other text here, 1234

(the text in lines is without any structure.. and sometimes includes different symbols as well... commas, dots etc.. but it always ends with a comma before the last four digigts - if it can help)

i need to get those last 4 digit numbers into a seperate collumn.

what would be the best way to do it?

Thanks in advance for your help.

1 Solution

Accepted Solutions
sivarajs
Specialist II
Specialist II

right('Your text here',4)

you can use in script like

load *, right('Your text here',4) as new_field

from test.qvd;

View solution in original post

1 Reply
sivarajs
Specialist II
Specialist II

right('Your text here',4)

you can use in script like

load *, right('Your text here',4) as new_field

from test.qvd;