Skip to main content
Announcements
Announcing Qlik Talend® Cloud and Qlik Answers™ to accelerate AI adoption! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
NikhilSandavekarCP
Contributor II
Contributor II

<> not working for the SQL statement

i am trying to extract order which doesnt have rejection code which are '62' and 'CC'

i tried using the same in SQL statement but not able to get the filtered data 

Below is my code : 


[/BIC/ACS_NA_C2_1]:
LOAD
[SALESORG] as [Sales Org],
[/BIC/ORD_IT_QT] as [Order-Item Qty],
[DLV_QTY] as [Delivery Qty],
[/BIC/ZCALMNTHG] as [Calendar Month],
[/BIC/ZCALYEARG] as [Calendar Year];

SQL Select SALESORG,/BIC/ORD_IT_QT, DLV_QTY, /BIC/ZCALMNTHG, /BIC/ZCALYEARG from /BIC/ACS_NA_C2 WHERE SALESORG = 'US01' and /BIC/ZCALMNTHG = '$(CurrMonth)' and /BIC/ZCALYEARG = '$(CurrYear)' and /BIC/ABGRU <> 'CC' or /BIC/ABGRU <> '62';

Labels (3)
1 Solution

Accepted Solutions
Taoufiq_Zarra

@NikhilSandavekarCP  and ?

[/BIC/ACS_NA_C2_1]:
LOAD
[SALESORG] as [Sales Org],
[/BIC/ORD_IT_QT] as [Order-Item Qty],
[DLV_QTY] as [Delivery Qty],
[/BIC/ZCALMNTHG] as [Calendar Month],
[/BIC/ZCALYEARG] as [Calendar Year],
[/BIC/ABGRU]

where Match([/BIC/ABGRU],'CC','62')=0;

SQL Select SALESORG,/BIC/ABGRU,/BIC/ORD_IT_QT, DLV_QTY, /BIC/ZCALMNTHG, /BIC/ZCALYEARG from /BIC/ACS_NA_C2 WHERE SALESORG = 'US01' and /BIC/ZCALMNTHG = '$(CurrMonth)' and /BIC/ZCALYEARG = '$(CurrYear)';
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

5 Replies
Taoufiq_Zarra

@NikhilSandavekarCP  have you tested ?

and ( /BIC/ABGRU <> 'CC' or /BIC/ABGRU <> '62')

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
NikhilSandavekarCP
Contributor II
Contributor II
Author

Hello Taoufiq,

 

I tried the same before but didnt work for me

Taoufiq_Zarra

@NikhilSandavekarCP  and ?

[/BIC/ACS_NA_C2_1]:
LOAD
[SALESORG] as [Sales Org],
[/BIC/ORD_IT_QT] as [Order-Item Qty],
[DLV_QTY] as [Delivery Qty],
[/BIC/ZCALMNTHG] as [Calendar Month],
[/BIC/ZCALYEARG] as [Calendar Year],
[/BIC/ABGRU]

where Match([/BIC/ABGRU],'CC','62')=0;

SQL Select SALESORG,/BIC/ABGRU,/BIC/ORD_IT_QT, DLV_QTY, /BIC/ZCALMNTHG, /BIC/ZCALYEARG from /BIC/ACS_NA_C2 WHERE SALESORG = 'US01' and /BIC/ZCALMNTHG = '$(CurrMonth)' and /BIC/ZCALYEARG = '$(CurrYear)';
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
NikhilSandavekarCP
Contributor II
Contributor II
Author

Thanks a lot that worked like a Charm!!!

MayilVahanan

HI @NikhilSandavekarCP 

Try with not in

 /BIC/ABGRU not in ('CC','62');

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.