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

Remove/Replace numbers after the string (particular number)

Hello, 

I have a string like "04160906       1". How to remove the number after the string "04160906" to show only first 8 numbers.

"04160906       1" into "04160906" (removing the string from spaces and after spaces the number).

The code where I want to need the changes

[Capacity]:
LOAD
	[@108:140] AS WorkPlace
FROM [lib://Data\Data.TXT]
(fix, codepage is 28591, no labels, header is 5 lines);

 

thanks for the response,

Ahsan

Labels (5)
1 Solution

Accepted Solutions
trdandamudi
Master II
Master II

It has nothing to do with 1. If you have the data as "04160906       1"

Then using the Mid([Your Field Name],1,8)  will give you  the result "04160906". It takes first eight digits only. Hope this helps.

View solution in original post

3 Replies
trdandamudi
Master II
Master II

You can use the Mid() function:

Something like:  Mid([Your Field Name],1,8) as New_Field_Name

 

AhsanNawaz
Contributor
Contributor
Author

But it is not always one (1) at the end of the string. I want to remove all the things which comes up after space. Any other solution?
trdandamudi
Master II
Master II

It has nothing to do with 1. If you have the data as "04160906       1"

Then using the Mid([Your Field Name],1,8)  will give you  the result "04160906". It takes first eight digits only. Hope this helps.