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: 
wgonzalez
Partner - Creator
Partner - Creator

Message "Garbage after statement".

I'm loading a table from QVD and added the sorting specifications, but I'm getting the error message "Garbage after statement".

Could someone explain?  Please see the script below.  Thanks.

AttTrans:

LOAD TransType,

     DTPunchDate,

     AttHours,

     EmpID,

     BusinessUnit,

     DeptNo,

     DeptName,

     WorkCenter,

     PayGroup,

     AbsenceYN,

     ParentTrans,

     AttendanceRevision,

     TardinessRevision,

     AttCategory

FROM

C:\QlikViewDocuments\Transf\Attendance\AttTrans.qvd

(qvd)

Order by DTPunchDate asc;

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Hi,

I reproduced your error and it is very strange. I'd say it is a bug.

As a workaround, if you really need your order by, you can load your table then use a load resident to order it.

It will be like this:

AttTrans:

LOAD TransType,

     DTPunchDate,

     AttHours,

     EmpID,

     BusinessUnit,

     DeptNo,

     DeptName,

     WorkCenter,

     PayGroup,

     AbsenceYN,

     ParentTrans,

     AttendanceRevision,

     TardinessRevision,

     AttCategory

FROM

C:\QlikViewDocuments\Transf\Attendance\AttTrans.qvd

(qvd);

noconcatenate

temp:

Load * resident AttTrans

Order by DTPunchDate asc;

drop table AttTrans;

rename table temp to AttTrans;

Hope it helps,

Erich


View solution in original post

5 Replies
erichshiino
Partner - Master
Partner - Master

Hi,

I reproduced your error and it is very strange. I'd say it is a bug.

As a workaround, if you really need your order by, you can load your table then use a load resident to order it.

It will be like this:

AttTrans:

LOAD TransType,

     DTPunchDate,

     AttHours,

     EmpID,

     BusinessUnit,

     DeptNo,

     DeptName,

     WorkCenter,

     PayGroup,

     AbsenceYN,

     ParentTrans,

     AttendanceRevision,

     TardinessRevision,

     AttCategory

FROM

C:\QlikViewDocuments\Transf\Attendance\AttTrans.qvd

(qvd);

noconcatenate

temp:

Load * resident AttTrans

Order by DTPunchDate asc;

drop table AttTrans;

rename table temp to AttTrans;

Hope it helps,

Erich


wgonzalez
Partner - Creator
Partner - Creator
Author

Nice solution, thanks!

wgonzalez
Partner - Creator
Partner - Creator
Author

Nice solution, thanks!

raajeshn
Partner - Creator
Partner - Creator

Hi,

Nice Solution, Thanks.

But am surprised, this is still an issue in QlikView 11.2 as well. Can somebody from Qlik have a dig at this please? Thanks.

Thanks & Regards,

Raajesh N

lawrenceiow
Creator II
Creator II

It says in the Help screen (and therefore, I would assume, the user guide) for the LOAD command, "order by is a clause used for sorting the records of a resident table before they are processed by the load statement" I would suggest that Order By is working as intended.