Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to exclude the multiple field values in the script

Dear All,

i am trying to exclude the multiple field values in the script by using like

Load *

from (qvd)

where not match( [Field1], 'a','b')

           and not mtach( [Filed2],03, 04)

But is not giving the expected no.of recprds .

could you please help me on this to exclude the multiple field values in the script.

Thanks in advance.

Bhupal

10 Replies
maxgro
MVP
MVP

I comment the where in my script and add some column;

you can still see the result of Where not match(field1, 'a', 'b') and not match(field2, '03', '04') in the 5th column, the rows with the red rectangle.

not match(field1, 'a', 'b')              --> you get the rows with c d         (green rectangle, 3rd col)

not match(field2, '03', '04')          --> you get the rows with 01          (green rectangle, 4th col)

not match (field1, 'a', 'b') and not match (field2, '03', '04')               (red rectangle, 5th col)


1.png

The 6th column, flag2, is the result with

Where not match(field1&field2, 'a03', 'a04', 'b03', 'b04')




SCRIPT


load *,

not match(field1, 'a', 'b') as notmatch_field1_ab,

not match(field2, 03, 04)  as notmatch_field2_0304,

not match(field1, 'a', 'b') and not match(field2, 03, 04) as notmatch_field1_ab_and_not_match_field2_0304,

not match(field1&field2, 'a03', 'a04', 'b03', 'b04') as flag2

inline [

field1, field2

a,01

b,01

c,01

d,01

a,03

b,03

c,03

d,03

a,04

b,04

c,04

d,04

]

//Where not match(field1, 'a', 'b') and not match(field2, 03, 04)

//Where not match(field1&field2, 'a03', 'a04', 'b03', 'b04') //and not match(field2, 03, 04)

;