Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
710 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 Answer

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 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...