Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
jim_chan
Specialist
Specialist

How to trim a value?

Hi guys, 

I have a problem here. the existing code looks like SG01_MEATY_ABCD_SG and i need to trim it removing front and back , and just keep the word "MEATY".  other code like "SAUSAGE001" with no special code at the front and back , should remain as it is. 

I have attached a sample qvw file. 

 

Please help guys!

Thanks.

Rgds,

Jim

Labels (2)
1 Reply
izzat_amir
Contributor
Contributor

Can u try the code below:

table1:
LOAD my_code,
if(wildmatch(my_code,'*_*'),subfield(my_code,'_',2),my_code) as new_my_code;
LOAD * INLINE [
my_code
SG01_MEATY_ABCD_SG
SG02_MEATY_CDEF_SG
SAUSAGE001
];