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: 
Not applicable

Can you use 'Order By' in a QVD Load?

Can you use 'Order By' in a QVD Load? It looks like my syntax is good but I get this error:

Garbage after statement

PATIENTLEVELDATA:

LOAD SURVEY_ID,

    CLIENT_ID,

    SERVICE,

    RECDATE,

    DISDATE,

    %Key_PATIENTLEVELDATA_E1A59225A73AF151   

FROM C:\QlickView\Dashboard\PATIENTLEVELDATA_4.QVD (qvd) Order By RECDATE

1 Solution

Accepted Solutions
jagannalla
Partner - Specialist III
Partner - Specialist III

Coming to your data.

Temp:

Load  *

from C:\QlickView\Dashboard\PATIENTLEVELDATA_4.QVD (qvd);

PATIENTLEVELDATA:

Load  *,1 as Flag

Resident Temp Order By RECDATE;

Drop table Temp;

View solution in original post

6 Replies
jagannalla
Partner - Specialist III
Partner - Specialist III

No you can't use Order By clause for qvd file. You can use for resident table only.

Eg:

Load A,B*C as E resident tab1 order by A;

jagannalla
Partner - Specialist III
Partner - Specialist III

Coming to your data.

Temp:

Load  *

from C:\QlickView\Dashboard\PATIENTLEVELDATA_4.QVD (qvd);

PATIENTLEVELDATA:

Load  *,1 as Flag

Resident Temp Order By RECDATE;

Drop table Temp;

jagan
Luminary Alumni
Luminary Alumni

Hi,

You can use order by only in Resident load only.  If you want to use order by then load QVD data into temporary table and then using resident load sort the data and then drop the temporary table.  Check the script below

TempTable:

LOAD

     *

FROM FileName.QVD (qvd);

Data:

LOAD

     *

RESIDENT TempTable

ORDER BY Field1, Field2;

DROP TABLE TempTable;

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

I did not realize this constraint on the ORDER BY clause: (described in Qlikview documentation) "This clause may only be used when the data source is a resident table."

Not applicable
Author

Thanks for the answer!

gauravkumar131
Partner - Contributor II
Partner - Contributor II

hey jaganand,

 

 

please check in sheet 1 and sort by key or sale whatever you take and show me the result.