Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Getting error while using Order by Desc

Hello everybody,

I have a piece of code as below

Map_SS:
Load
INVOICENUMBER,
[DATE STEP CREATED DERIVED]
FROM  a.QVD(qvd)
where STEPNAME='Complete PeopleSoft Process' order by [DATE STEP CREATED DERIVED] desc;

DATE_STEP_CREATED_DERIVED:

Mapping LOAD * Resident Map_SS;
drop table Map_SS;

While loading it is giving an error message stating Garbage after statement.

Could anyone please help me how to use Order by desc here?

Thanks in Advance

Sonali

1 Solution

Accepted Solutions
VishalWaghole
Specialist II
Specialist II

Hi Sonali,

Order by is not working with ordinary load.

If you load it again as resident then it will work.

Like this

Map_SS:

Load   INVOICENUMBER,

          [DATE STEP CREATED DERIVED]

FROM  a.QVD(qvd)

where STEPNAME='Complete PeopleSoft Process';

Load   INVOICENUMBER,

          [DATE STEP CREATED DERIVED]

Resident Map_SS

order by [DATE STEP CREATED DERIVED] desc;

-- Regards,

Vishal Waghole

View solution in original post

8 Replies
michael_maeuser
Partner Ambassador
Partner Ambassador

order by does only work in resident load

michael_maeuser
Partner Ambassador
Partner Ambassador

so just load your table resident and drop the original

VishalWaghole
Specialist II
Specialist II

Hi Sonali,

Order by is not working with ordinary load.

If you load it again as resident then it will work.

Like this

Map_SS:

Load   INVOICENUMBER,

          [DATE STEP CREATED DERIVED]

FROM  a.QVD(qvd)

where STEPNAME='Complete PeopleSoft Process';

Load   INVOICENUMBER,

          [DATE STEP CREATED DERIVED]

Resident Map_SS

order by [DATE STEP CREATED DERIVED] desc;

-- Regards,

Vishal Waghole

its_anandrjs
Champion III
Champion III

Order by clause will work only in the resident table then try like

Temp_Map_SS:
Load
INVOICENUMBER,
[DATE STEP CREATED DERIVED]
FROM  a.QVD(qvd);

Noconcatenate

Map_SS:

Load
INVOICENUMBER,
[DATE STEP CREATED DERIVED]

Resident Temp_Map_SS

where STEPNAME='Complete PeopleSoft Process' order by [DATE STEP CREATED DERIVED] desc;

Drop Table Temp_Map_SS;

DATE_STEP_CREATED_DERIVED:

Mapping LOAD * Resident Map_SS;
drop table Map_SS;

michael_maeuser
Partner Ambassador
Partner Ambassador

see first answer...

its_anandrjs
Champion III
Champion III

HI Sonali,

And another way for this is in resident load make the table as Mapping table see the script below and try this code also.

Temp_Map_SS:
Load
INVOICENUMBER,
[DATE STEP CREATED DERIVED]
FROM  a.QVD(qvd);

Noconcatenate

DATE_STEP_CREATED_DERIVED:  

Mapping Load
INVOICENUMBER,
[DATE STEP CREATED DERIVED]

Resident Temp_Map_SS

where STEPNAME='Complete PeopleSoft Process' order by [DATE STEP CREATED DERIVED] desc;

Drop Table Temp_Map_SS;

Not applicable
Author

Thank You All For Your Reply....    

VishalWaghole
Specialist II
Specialist II

Most Welcome Sonali