Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Live Chat, June 29th 10AM ET. Bring your Qik Sense Enterprise, Client Managed questions! REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
wlpike
Contributor III
Contributor III

load script sql not equal not working

Hi Everybody!

 

i want to import data from a datacube in SAP BW and select a time period after december 2017 and all products, except 'MNPZ'.

Time period in SQL where clause is working, but not my product selection. To realize a "not equal" expression, i used  "<>", "!="  and "NOT x=y" 

This is my code, please help if somethings wrong.

 

 

LOAD  
	PRDCTH0CS, 
    SALES_1R1,
    NET_VA09T,
    [0CALYEAR], 
	[0CALMONTH2], 
	[0CALDAY], 
	[0CALMONTH]
    
        
;




    
    
SELECT	
[PRDCTH0CS],
[SALES_1R1],
[NET_VA09T],
[0CALYEAR], 
[0CALMONTH2], 
[0CALDAY], 
[0CALMONTH], 
	
FROM RLICVERT

WHERE 
[0CALMONTH] > 201712  AND

[PRDCTH0CS] <> 'MNPZ'
;

 

 

thanks

 

BR

Chris

1 Solution

Accepted Solutions
Ezir
Creator II
Creator II

Hi @wlpike ,

This depends on your database syntax, but you can do it from Qlik... See below

LOAD  
    PRDCTH0CS, 
    SALES_1R1,
    NET_VA09T,
    [0CALYEAR], 
    [0CALMONTH2], 
    [0CALDAY], 
    [0CALMONTH]
WHERE PRDCTH0CS <> 'MNPZ';
   
SELECT	
[PRDCTH0CS],
[SALES_1R1],
[NET_VA09T],
[0CALYEAR], 
[0CALMONTH2], 
[0CALDAY], 
[0CALMONTH]
FROM RLICVERT
WHERE [0CALMONTH] > 201712;

 

Regards,

 

Ezir

 

View solution in original post

3 Replies
Ezir
Creator II
Creator II

Hi @wlpike ,

This depends on your database syntax, but you can do it from Qlik... See below

LOAD  
    PRDCTH0CS, 
    SALES_1R1,
    NET_VA09T,
    [0CALYEAR], 
    [0CALMONTH2], 
    [0CALDAY], 
    [0CALMONTH]
WHERE PRDCTH0CS <> 'MNPZ';
   
SELECT	
[PRDCTH0CS],
[SALES_1R1],
[NET_VA09T],
[0CALYEAR], 
[0CALMONTH2], 
[0CALDAY], 
[0CALMONTH]
FROM RLICVERT
WHERE [0CALMONTH] > 201712;

 

Regards,

 

Ezir

 

View solution in original post

wlpike
Contributor III
Contributor III
Author

Hi Ezir,

 

thanks, it worked.

could there be a negative impact, if i do a where clause in "load" and not in "Select" statement?

and why should it not be possible to do a simple SQL where clause...

thanks

br

Chris

wlpike
Contributor III
Contributor III
Author

Addition:

 

from Qlik Script Generator i got following code that works too, but i still get product 'MNPZ' in Dashboard, but without data, so value of sold products is "0".

 

WHERE (
	[PRDCTH0CS] <> MNPZ,
	[0CALMONTH] > 201712
);

 

could this be a bug of some kind?

 

thanks

br

chris