Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
psk180590
Creator III
Creator III

Check for particular value in a text field.

Hello All,

 

I have the following values in my data.

TEXT:

A01// External Sales Data

A13// TV Campaign

No Activity

 

Here, i would like to check if the values in TEXT have // and then extract the first 3 values.

From the above mentioned data i would like to only display A01 and A13.

 

TIA

Sai.

Labels (1)
4 Replies
sergio0592
Specialist III
Specialist III

Hi,

It works with :

TEXT:
load if (wildmatch(Field,'*//*'), SubField(Field,'//',1),'') as Field2
inline [
Field
A01// External Sales Data
A13// TV Campaign
No Activity];

Anil_Babu_Samineni

Perhaps this?
If(istext(field), sibfield(field, '//', 1), field) as new
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I would prefer using Index and Left functions. Take a look:

LOAD *
	,If(Index(text, '//'), Left(text, 3), null()) as Result
INLINE [
text
A01// External Sales Data
A13// TV Campaign
No Activity
];

This is your expected results:

 Screenshot_2.jpg

Also, I do advise you instead of Null() in If statement to you something that's easy to count and find.

If(Index(text, '//'), Left(text, 3), ':') as Result

 

psk180590
Creator III
Creator III
Author

Thanks all for you valubale suggestions.
For the same data i have found out that there is another Text field, now i have to check both the fields and then extract the Value if exists in either one of them.

Please, check the attached excel.

Value.PNG

 

 



In the first Column Text2 is Empty, Second one has Text Empty, Third one has both the Values same and the Fourth one has no Values.

TIA!!