Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
rajinikanth
Contributor III
Contributor III

Extract specific from a field value

I have text as below in a field value highlighted in blue.

"Enter the subject, choose a Board and ask away! You might just find a similar question that has been answered.

%%ABC%% World is approaching! Take your data to the next level %%DEF%%and similar $$123$$

New solution %%IJH%% Timetable %%XYZ%%"

I want to extract all values starting with between %% as below 

Field
ABC
DEF
IJH
XYZ
















 

Labels (4)
1 Solution

Accepted Solutions
OmarBenSalem

Sure

Just add this

load Concat(distinct Field,',') as Field;
load Field where len(trim(Field))=3;
load purgechar(Subfield,'%') as Field where left(Subfield,1)='%' and right(Subfield,1)='%';
load replace(Field,'%%','%|%') as Field,
SubField(replace(Field,'%%','%|%'),'|') as Subfield Inline [
Field
"Enter the subject, choose a Board and ask away! You might just find a similar question that has been answered."

"%%ABC%% World is approaching! Take your data to the next level %%DEF%%and similar $$123$$"

"New solution %%IJH%% Timetable %%XYZ%%"
];

OmarBenSalem_0-1650983551445.png

 

 

View solution in original post

4 Replies
Frank_E-W
Partner - Contributor III
Partner - Contributor III

Your question might already have been answered here: 

Solved: Multiple TextBetween? - Qlik Community - 998974

 

 

OmarBenSalem

load Field where len(trim(Field))=3;
load purgechar(Subfield,'%') as Field where left(Subfield,1)='%' and right(Subfield,1)='%';
load replace(Field,'%%','%|%') as Field,
SubField(replace(Field,'%%','%|%'),'|') as Subfield Inline [
Field
"Enter the subject, choose a Board and ask away! You might just find a similar question that has been answered."

"%%ABC%% World is approaching! Take your data to the next level %%DEF%%and similar $$123$$"

"New solution %%IJH%% Timetable %%XYZ%%"
];

OmarBenSalem_0-1650979739103.png

 

rajinikanth
Contributor III
Contributor III
Author

Hi Omar, Thanks  a ton it worked out for me, can i get values like the below filed as output.

 

Field
ABC,DEF,IJH,XYZ
OmarBenSalem

Sure

Just add this

load Concat(distinct Field,',') as Field;
load Field where len(trim(Field))=3;
load purgechar(Subfield,'%') as Field where left(Subfield,1)='%' and right(Subfield,1)='%';
load replace(Field,'%%','%|%') as Field,
SubField(replace(Field,'%%','%|%'),'|') as Subfield Inline [
Field
"Enter the subject, choose a Board and ask away! You might just find a similar question that has been answered."

"%%ABC%% World is approaching! Take your data to the next level %%DEF%%and similar $$123$$"

"New solution %%IJH%% Timetable %%XYZ%%"
];

OmarBenSalem_0-1650983551445.png