Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Join us at the Cloud Data and Analytics Tour! REGISTER TODAY
Showing results for 
Search instead for 
Did you mean: 
Not applicable

LTrim and replace, with exception.

Hi all,

I have the following script which works in eliminating the Zero’s and blank spaces in the imported field “Material”.

replace(ltrim(replace(Material, '0', ' ')), ' ', 0) as Product,  

I need this to exclude any item in “Material” that contains “.” Or “/” from the action of the above script but still include them in the new field “Product".

For example:

An item in Material that is

000000123456 needs to become 123456

But 0002.abc needs to remain as 0002.abc

The current action returns this as 2.abc

All spaces in the item need to be removed, which I believe the trim action achieves

The Material field contains text and numbers and both.

The new field Product then should contain all entries, so if you start with 1000 you end up with 1000 that been subject to the script actions.

If anyone has any idea how this can be achieved, I'd appreciate the help.


2 Replies


Use Subfield( ) function to remove . from the field after doing do some thing like Subfield(0002.abc,'.' 1)



Not applicable

how about:


if(isnum(Material),num(Material),Material) as Product,