Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to extract the text's before the open braces. How can I do that. Here I am pasting my data points, please help me out how I can do that.
GUJRAT |
MUMBAI (2 to 2.5 Kg) |
NASIK (2 to 2.5 Kg) |
PUNE (2 to 2.5 Kg) |
PUNJAB (1.8 to 2 Kg) |
PUNJAB (1.4 to 1.6 Kg) |
PUNJAB (1 Kg) |
SKYLARK HR (2 to 2.3 Kg) |
SKYLARK HR (1.6 to 1.7 Kg) |
SKYLARK HR (1.2 to 1.3 Kg) |
RAIPUR (1.8 to 2.5 kg) |
RAIPUR (1.1 to 1.3 kg) |
Regards,
Rakesh Paul
With Subfield function:
Data:
LOAD GUJRAT
FROM
[http://community.qlik.com/thread/148004]
(html, codepage is 1252, embedded labels, table is @1);
LOAD
GUJRAT,
SubField(GUJRAT, '(', 1) as Previo
resident Data;
DROP TABLE Data;
GUJRAT | Previo |
---|---|
MUMBAI (2 to 2.5 Kg) | MUMBAI |
NASIK (2 to 2.5 Kg) | NASIK |
PUNE (2 to 2.5 Kg) | PUNE |
PUNJAB (1 Kg) | PUNJAB |
PUNJAB (1.4 to 1.6 Kg) | PUNJAB |
PUNJAB (1.8 to 2 Kg) | PUNJAB |
RAIPUR (1.1 to 1.3 kg) | RAIPUR |
RAIPUR (1.8 to 2.5 kg) | RAIPUR |
SKYLARK HR (1.2 to 1.3 Kg) | SKYLARK HR |
SKYLARK HR (1.6 to 1.7 Kg) | SKYLARK HR |
SKYLARK HR (2 to 2.3 Kg) | SKYLARK HR |
if(findoneof(Fieldname,'('),subfield(fieldname,' ',1),fieldname)
hope this helps
another option, using left and index functions (in script or in chart, image is for chart)
left(GUJRAT, index(GUJRAT, '(')-1)
Hi,
Try this for both part 1 and part 2 extract
Tabe1:
LOAD GUJRAT
FROM
[http://community.qlik.com/thread/148004]
(html, codepage is 1252, embedded labels, table is @1);
TABLE2:
LOAD
*,
SubField(GUJRAT,'(',1) AS Extract_Part_1
,'('& SubField(GUJRAT,'(',2) AS Extract_Part_2
Resident Tabe1
;
Hope this helps
Hi,
also possible:
LOAD TextBetween('@'&GUJRAT,'@','(') as GUJRAT
FROM [http://community.qlik.com/thread/148004] (html, codepage is 1252, embedded labels, table is @1);
hope this helps
regards
Marco