Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

where clause in QVD load

Hi,

Any idea why this script is ignoring the Where clause?  It should only load records where STATE = 'CA', but it just loads everything. 

LOAD [First Name],

     [Last Name],

     State,

     Title,

     Company,

     ActivityDate

FROM

(qvd)

WHERE(State = 'CA');

Thanks

14 Replies
colinh
Partner - Creator II
Partner - Creator II

Try it without the brackets:  WHERE State = 'CA';

Not applicable
Author

Check for the Space in Data

you can use trim function

LOAD [First Name],

     [Last Name],

     State,

     Title,

     Company,

     ActivityDate

FROM

(qvd)

Where trim(State) = 'CA';

Not applicable
Author

I tried Trim and I tried removing the brackets.  No better.  The original code was actually generated with the load wizard, incidentally.

colinh
Partner - Creator II
Partner - Creator II

In your data is the value 'ca' or 'CA'?  Try where upper(State) = 'CA';

Not applicable
Author

There are lots of different values but definitely some having CA.  But my problem is that all data gets loaded, not that some are being wrongly excluded.

FYI, I originally was trying to select on a numeric value but the Where clause didn't work for that one either.

colinh
Partner - Creator II
Partner - Creator II

Very odd.  Using the wizard to create an almost identical statement works fine for me.

What version / service release of QlikView are you using?

Not applicable
Author

Yes, agree it's weird.  Either something in my data or there's a higher level setting someplace.  But I haven't changed any defaults.

If it matters, I'm running Windows 7 64 bit, and running QV 10.00.8815.6 SR1 64-bit.  Maybe I'll try downloading some patches.

colinh
Partner - Creator II
Partner - Creator II

SR1 was, in my very short experience with it, very buggy.  I would upgrade to SR3 and see if that fixes the problem.

Not applicable
Author

No, SR3 didn't fix it.  Don't understand.  Seems so simple.