Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
sicilianif
Creator II
Creator II

Calculation in SAP SQL where clause?

Every time I try to use a calculation in a where clause for an SAP select statement I get an open stream error. Below is the load/select statement that I am issuing. Does anyone know if this works?


LOAD [/BIC/ZBATCHA],
CALDAY,
ISSTOTSTCK,
MATERIAL,
RECTOTSTCK;
SQL SELECT /BIC/ZBATCHA,
CALDAY,
ISSTOTSTCK,
MATERIAL,
RECTOTSTCK
FROM /BIC/AZIC_D0500 WHERE RECTOTSTCK - ISSTOTSTCK <> 0;;


2 Replies
disqr_rm
Partner - Specialist III
Partner - Specialist III

Try:

LOAD [/BIC/ZBATCHA],
CALDAY,
ISSTOTSTCK,
MATERIAL,
RECTOTSTCK;
SQL SELECT /BIC/ZBATCHA,
CALDAY,
ISSTOTSTCK,
MATERIAL,
RECTOTSTCK
FROM [/BIC/AZIC_D0500] WHERE [RECTOTSTCK] - [ISSTOTSTCK] <> 0;

If doesn't work you may have to move your WHERE condition in preload section. Some thing like this:

LOAD [/BIC/ZBATCHA],
CALDAY,
ISSTOTSTCK,
MATERIAL,
RECTOTSTCK
WHERE RECTOTSTCK - ISSTOTSTCK <> 0;
SQL SELECT /BIC/ZBATCHA,
CALDAY,
ISSTOTSTCK,
MATERIAL,
RECTOTSTCK,
FROM [/BIC/AZIC_D0500];

sicilianif
Creator II
Creator II
Author

Just putting the fields in brackets does not help.

If I put it in the load statement, wouldn't it still pull all the data? I am working with a table that has 65 million records. 20 million+ of which can be weeded out if I can do the calculation.