Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save $300 before February 6: REGISTER NOW!
cancel
Showing results for 
Search instead for 
Did you mean: 
joanioconnor
Contributor
Contributor

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
mark6505
Partner - Master
Partner - Master

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

mark6505
Partner - Master
Partner - Master

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