Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

LauraMorris
New Contributor

Using where clause in load statement

Having searched the forum and tried many of the suggestions I still cannot get a simple where clause to work in my load script. I've been going round in circles for 9 hours now.  Looking at previous answers I need to use a resident load and do it there but I'm still getting either 0 results if I use ' or everything if I dont use any quotes. I've taken all other tables out until I get this bit working to try and simplify things. My script at the minute is:

 

[service2]:
LOAD
"$_serviceid",
....
"$_clientid",
FROM [lib://QVDs/PHS QVDs DEV\service.qvd]

(qvd);


[service]:

NOCONCATENATE  LOAD

*

RESIDENT service2

WHERE $_clientid = 37;

DROP TABLE service2;

Labels (3)
1 Reply
Partner
Partner

Re: Using where clause in load statement

Try to alias your column name:
[service2]:
LOAD
"$_serviceid" as [ServiceID],
....
"$_clientid" as [ClientID],
FROM [lib://QVDs/PHS QVDs DEV\service.qvd]

(qvd);


[service]:

NOCONCATENATE LOAD

*

RESIDENT service2

WHERE [ClientID] = 37;

DROP TABLE service2;