Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I have below script in which I used wildcards while loading data. Condition for [Phone No] is if it starts with 9 or 8 or 65 then that row should not be loaded. But, in below case data isn't getting loaded if [Phone No] field is blank. But I want blank [Phone No] field as well to be loaded.
LOAD Distinct
Upper(Name),
Upper(Date) ,
Upper(Address),
Upper([Phone No])
FROM
(qvd)
Where not WildMatch(Name,'*-*') and
not WildMatch(Date,'*-*') and
not WildMatch([Phone No],'9*','8*','65*');
how about adding an OR condition checking if phone No is blank....
Hi Mahendra,
WildMatch(Name,'*-*')
Are you sure you want to exclude all names containing a - (such as 'Ronald-Alexander').
If you were trying to exclude Nulls (displayed as "-"), you want to go with:
WHERE NOT ISNULL(Name) AND NOT ISNULL(Date)
Aside from that, I see no reason not WildMatch([Phone No],'9*','8*','65*') should prevent empty phone numbers from being loaded.
Use this:
LOAD Distinct
Upper(Name),
Upper(Date) ,
Upper(Address),
Upper([Phone No])
FROM
(qvd)
Where not WildMatch(Name,'*-*') and
not WildMatch(Date,'*-*') and
not WildMatch([Phone No],'9*','8*','65*')
and isnull([Phone No])
and len[Phone No])<1;
Hello Ronald,
yes this is correct WildMatch(Name,'*-*'). The only thing I also wonder why it is not showing value if [Phone No] is blank.
Thanks for your response but it is not working
Hello,
To make this easy to understand I'm attaching demo qvw as well as excel file.
Hi Mahendra,
In that case, try:
Where not WildMatch(Name,'*-*') and
not WildMatch(Date,'*-*')
and (not WildMatch([Phone No],'9*','8*','65*')
or IsNull([Phone No]));