Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to duplicate field and have the new field display only wanted records

Hi, I want to duplicate an existing field called DESCRIPTION and name the duplicated field 'description' and I only want 'decscription' to display descriptions which start with 'U' and 'u'. How do I do this? Thanks.

1 Solution

Accepted Solutions
anbu1984
Master III
Master III

DESCRIPTION and name the duplicated field 'description'


Load *,If(Upper(DESCRIPTION) like 'U*',DESCRIPTION) as description Resident tab;

Or

Load *,If(DESCRIPTION like 'U*' Or DESCRIPTION like 'u*',DESCRIPTION) as description Resident tab;

Or

Load *,If(WildMatch(DESCRIPTION,'U*'),DESCRIPTION) as description Resident tab;

View solution in original post

6 Replies
Not applicable
Author

LOAD IF(LEFT(DESCRIPTION,1)='U' OR LEFT(DESCRIPTION,1)='u',DESCRIPTION,NULL()) AS description

RESIDENT......

anbu1984
Master III
Master III

DESCRIPTION and name the duplicated field 'description'


Load *,If(Upper(DESCRIPTION) like 'U*',DESCRIPTION) as description Resident tab;

Or

Load *,If(DESCRIPTION like 'U*' Or DESCRIPTION like 'u*',DESCRIPTION) as description Resident tab;

Or

Load *,If(WildMatch(DESCRIPTION,'U*'),DESCRIPTION) as description Resident tab;

Not applicable
Author

I used your 2nd statement but now 'description' has blank records and descriptions which start with 'U' and 'u'. How do I remove those blank records? Thanks.

Not applicable
Author

Use WHERE NOT ISNULL(If(DESCRIPTION like 'U*' Or DESCRIPTION like 'u*',DESCRIPTION));

preminqlik
Specialist II
Specialist II

Load *

where not isnull(NewDescription);

Load *,

if(left(capitalize(trim(DESCRIPTION)),1)='U','Description')          as          NewDescription

from path;

anbu1984
Master III
Master III

Tab1:

Load *,If(DESCRIPTION like 'U*' Or DESCRIPTION like 'u*',DESCRIPTION) as description Resident tab;


Final:

Load * Resident Tab1 Where Not(IsNull(description));