Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

When I use a where statement in load script that looks like this: WHERE LineType = '1' AND isnull(OpenOrderQty,0) <> 0; I run in debug mode, I get the following error message: ErrorSource: Unknown source, ErrorMsg: Unknown description SQL SELECT * FROM S

When I use a where statement  in load script that looks like this: WHERE LineType = '1' AND isnull(OpenOrderQty,0) <> 0; I run in debug mode, I get the following error message:

ErrorSource: Unknown source, ErrorMsg: Unknown description SQL SELECT * FROM SysproCompanyTurf.dbo.SorDetail WHERE LineType = '1' AND isnull(OpenOrderQty,0) <> 0.

I only want to load the data where Linetype=1 and where OpenOrderQty<> 0. And I'm a newbie to both Qlikview and SQL

OpenOrderQty is a "calulated" field in the LOAD statement before the WHERE clause

MShipQty + MBackOrderQty as OpenOrderQty,

I've tried OpenOrderQty <>0

I've tried OpenOrderQty <>'0'

1 Solution

Accepted Solutions
Mark_Little
Luminary
Luminary

Hi

You can't use a where clause for a field that is being calculated in the load script.

You will need something like

Where (MShipQty <> 0 and MBackOrderQty <> 0) Or (LEN(TRIM(MShipQty)) <> 0 and LEN(TRIM(MBackOrderQty)) <> 0) AND LineType = 1.

I prefer to use Len and Trim over isnull incase of random spaces.

Mark

View solution in original post

3 Replies
chinnuchinni
Creator III
Creator III

try this:

(MShipQty + MBackOrderQty ) <> 0

sasiparupudi1
Master III
Master III

You Can not use a calculated field in the where condition.

Try like this

SQL SELECT * FROM SysproCompanyTurf.dbo.SorDetail WHERE

LineType = '1' AND

(IsNull(MShipQty,0) +IsNUll(MBackOrderQty,0))<>0

Mark_Little
Luminary
Luminary

Hi

You can't use a where clause for a field that is being calculated in the load script.

You will need something like

Where (MShipQty <> 0 and MBackOrderQty <> 0) Or (LEN(TRIM(MShipQty)) <> 0 and LEN(TRIM(MBackOrderQty)) <> 0) AND LineType = 1.

I prefer to use Len and Trim over isnull incase of random spaces.

Mark