Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a qvd and few fields. Now when i load that qvd instead of loading whole data i need to only few system codes.
For that i am writing hard coding in where condition as below:
Where
WildMatch(SystemCode,'722006',
'722008',
'722010',
'722005',
'722011',
'722012',
'722013',
'722023',
'722025',
'722026');
Can you please tell me is there any approach to remove this had coding.
Thanks,
Bharat
hmm,
you may put your condition into a variable:
LET myFilter = '722006, 722008';
LOAD .... FROM ....
WHERE WILDMATCH(Systemcode, $(myFilter));
The above may work easy for numbers, strings must be enclosed in apostrophs:
LET myFilter = CHR(39) & '722006' & CHR(39) & ',' & CHR(39) & '722008' & .... etc.
LET myFilter = CHR(39) & '*' & CHR(39) would not filter anything ...
Hi,
the script can't guess the references you want to remove, so you have to write it somewhere.
you can put it in a variable at the beginning of the script and call the variable on the WHERE, it will look cleaner maybe ?
Thanks for your reply.
Can you please tell me how to do..
hmm,
you may put your condition into a variable:
LET myFilter = '722006, 722008';
LOAD .... FROM ....
WHERE WILDMATCH(Systemcode, $(myFilter));
The above may work easy for numbers, strings must be enclosed in apostrophs:
LET myFilter = CHR(39) & '722006' & CHR(39) & ',' & CHR(39) & '722008' & .... etc.
LET myFilter = CHR(39) & '*' & CHR(39) would not filter anything ...
he is mentioned like create a variable like
set records=
WildMatch(SystemCode,'722006',
'722008',
'722010',
'722005',
'722011',
'722012',
'722013',
'722023',
'722025',
'722026');
then call the variable like
where $(records)
it is similar to your syntax but just reduce the hardcode
Guys already shows you examples below
Thank you so much...
Using joins
RequiredEntries:
Load * INLINE
[
Required
'722006'
'722008'
'722010'
'722005'
'722011'
'722012'
'722013'
'722023'
'722025'
'722026'
];
.......
Where EXISTS (SystemCode, Required)
JOIN is a really performant tool, however you may not change it to load all, as the OP has asked for.