Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Extract number from text field

hi in the following excel applikation i wish to extract only the last four numbers off each row.

if a row is lacking the four numbers (companycode) i wish not to read them.

i have tried trim function without luck as each of the rows have different lengths;

any suggestions?

Best,

Brad

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try something like

Company:

LOAD

     Company,

     if(isnum(right(Company,4)),right(Company,4)) as Company_num,

FROM

CompanyList.xlsx

(ooxml, embedded labels, table is Sheet1);

or if you only want to read these companies:

Company:

LOAD

     Company,

     right(Company,4) as Company_num

FROM

CompanyList.xlsx

(ooxml, embedded labels, table is Sheet1)

where isnum(right(Company,4));

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

I suggest you attach the excel file.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks i have attached the excel sheet

swuehl
MVP
MVP

Try something like

Company:

LOAD

     Company,

     if(isnum(right(Company,4)),right(Company,4)) as Company_num,

FROM

CompanyList.xlsx

(ooxml, embedded labels, table is Sheet1);

or if you only want to read these companies:

Company:

LOAD

     Company,

     right(Company,4) as Company_num

FROM

CompanyList.xlsx

(ooxml, embedded labels, table is Sheet1)

where isnum(right(Company,4));