Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data Quality Issue

I have this data quality issue and I have attched the sample QVW (With my requirement as comments and the Excel file.Please help me here.

Thanks much

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

You could use the Index() command to check whether LeaseCode has an underscore in it and set the AreaCode to Null() if it does not.

Leas:

LOAD

    Code as LeaseCode,

//    right([Code],4) as AreaCode,

        if ( index ( Code ,'_' ) > 0 , right(

,4) , null() ) as AreaCode,

    Key as Buildgkey

FROM

Sample.xlsx

(ooxml, embedded labels, table is Leas);

View solution in original post

3 Replies
Anonymous
Not applicable
Author

You could use the Index() command to check whether LeaseCode has an underscore in it and set the AreaCode to Null() if it does not.

Leas:

LOAD

    Code as LeaseCode,

//    right([Code],4) as AreaCode,

        if ( index ( Code ,'_' ) > 0 , right(

,4) , null() ) as AreaCode,

    Key as Buildgkey

FROM

Sample.xlsx

(ooxml, embedded labels, table is Leas);

Not applicable
Author

Thank you Bill Markham that worked , meanwhile I tried wildmatch

if(wildmatch([Code],'*_*'),  right([Code],4)) as [ Area Code],

and that worked too

Thank you and appreciate your help.

Anonymous
Not applicable
Author

Glad you are ok now.

Wildmatch() would do the same, just a few more keystrokes to type and I am a lazy typer.