Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
I am struggling with a problem on data manipulation. Trying to exclude some data at my load script.
Here is a simplified example;
Product Name | Type | sales |
A | 1 | 333 |
A | 2 | 816 |
A | 3 | 580 |
B | 1 | 472 |
B | 2 | 718 |
B | 3 | 749 |
B | 4 | 985 |
C | 1 | 831 |
C | 2 | 192 |
C | 3 | 145 |
C | 4 | 402 |
D | 1 | 88 |
D | 2 | 388 |
D | 3 | 176 |
I want to remove all A B C products as long as their type is 1 and 2. But on top of that, I also
want to remove all C products as long as its type is 1 2 and 3.
I think I am able to remove all A B C with their same types as 1 and 2. Like this
where not match ([Product Name], 'A,'B','C', ) or not Match([Type],'1', '2')
but how can I deal with product C 's 3 without impacting others?
you can try to make C as one separate loop like ...
where not match ([Product Name], 'A,'B','C', ) or not Match([Type],'1', '2')
and (not match ([Product Name],'C') or not Match ([Type],'3'))
pretty make the best of the logic of parenthesis
Hi,
Give this a try. It worked on your test data.
where not (match([Product Name], 'A','B') and Match([Type],'1', '2'))
and not ([Product Name]='C' and Match([Type],'1', '2', '3') );
Regards
Anthony
you can try to make C as one separate loop like ...
where not match ([Product Name], 'A,'B','C', ) or not Match([Type],'1', '2')
and (not match ([Product Name],'C') or not Match ([Type],'3'))
pretty make the best of the logic of parenthesis