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

Extracting values from string

Hi, 

 

Please see below. I would like to extract the values highlighted and create a new field.

 
 

EG: 2_6058_Resignation_Demographics_2019-10-28_00_00_00_2019-10-29_00_00_00 I want to only keep 6058

Please assist.

Capture.PNG

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

May be this while you load the file

LOAD SubField(FileBaseName(), '_', 2) as NewField

View solution in original post

3 Replies
sunny_talwar

May be this while you load the file

LOAD SubField(FileBaseName(), '_', 2) as NewField
zhadrakas
Specialist II
Specialist II

maybe like this
Load *,
subfield(subfield(filename(), '2_', -1),'_',1) as Version1
FROM yourfile;

regards
tim
Brett_Bleess
Former Employee
Former Employee

Sanele, did Sunny or Tim's posts help you get things working as you wished?  If so, be sure to return to the thread and use the Accept as Solution button on the post that helped you get things working to give credit for the help and let others know what worked.  If you are still working on things and need further help, please leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.