Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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);
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);
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.
Glad you are ok now.
Wildmatch() would do the same, just a few more keystrokes to type and I am a lazy typer.