Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
904 views
in Technique[技术] by (71.8m points)

numeric - only get numberic value in qlikview

i have this kind of data

-
B-3-I11
B-3-I12
BI1-I190
BI1-I191
BI1-I192L
BI1-I194A
BI1-I195L
BI1-I198R
BI1-I199L
BI1-I200Ac
BI1-I201L
conasde
Installation
Madqw
Medsfg
Woasd

this is the data I have .. now I want only those which start from B and have some numeric character in data..how I get in qlikview script

how to extract only those data ..


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To filter to those that start with B you'd do

where left(Field,1)=B

Then to filter on those with numbers, you could add

and len(keepchar(Field,'1234567890'))>0

So that would give something like this:

LOAD Field 
From Table 
Where left(Field,1)=B 
AND len(keepchar(Field,'1234567890'))>0

(where Field is the name of the field your data is in and Table is the name of the table your data is in)

Or, if you want to keep all the data but create a new field you would do:

LOAD 
    Field,
    if(left(Field,1)=B AND len(keepchar(Field,'1234567890'))>0`,Field) as FieldFiltered
From Table 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...