Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ORDER BY after WHERE selection in Load Script Error

Hi,

Can anyone please shed any light on why my ORDER BY statement doesn't work after my WHERE selection when loading a table from qvd within the script.

The WHERE statement works fine but throws an error "Garbage after statement" when i add the ORDER BY and try to reload the data.

Any help will be great!

Thanks, Joe

This is the code I am using:























TOPSSALES1:

LOAD




[Invoice Number],
[Order Number]

,
[Kit Indicator],


[Customer Code]

,
[Invoice Date]

,
Date

([Invoice Date]) AS InvoiceDate,
[Financial Week]



FROM





(
qvd) WHERE [Invoice Date] > '2009-01-01' AND [Kit Indicator] <> 'P' AND [Kit Indicator] <> 'C' ORDER BY InvoiceDate ASC;






1 Solution

Accepted Solutions
Not applicable
Author

Hi,

You can't order a qvd file, for doing it, your code must be the following:


TOPSSALES1Temp:
LOAD
[Invoice Number],
[Order Number],
[Kit Indicator],
[Customer Code],
[Invoice Date],
Date ([Invoice Date]) AS InvoiceDate,
[Financial Week]
FROM (qvd)
WHERE [Invoice Date] > '2009-01-01' AND [Kit Indicator] <> 'P' AND [Kit Indicator] <> 'C';
TOPSSALES1:
NOCONCATENATE LOAD *
RESIDENT TOPSSALES1Temp
ORDER BY InvoiceDate ASC;
DROP TABLE TOPSSALES1Temp;


View solution in original post

3 Replies
Not applicable
Author

Hi,

You can't order a qvd file, for doing it, your code must be the following:


TOPSSALES1Temp:
LOAD
[Invoice Number],
[Order Number],
[Kit Indicator],
[Customer Code],
[Invoice Date],
Date ([Invoice Date]) AS InvoiceDate,
[Financial Week]
FROM (qvd)
WHERE [Invoice Date] > '2009-01-01' AND [Kit Indicator] <> 'P' AND [Kit Indicator] <> 'C';
TOPSSALES1:
NOCONCATENATE LOAD *
RESIDENT TOPSSALES1Temp
ORDER BY InvoiceDate ASC;
DROP TABLE TOPSSALES1Temp;


Not applicable
Author

Sorted! 🙂 Thank you very much!

Joe

suniljain
Master
Master

Dear

is there anyother way to Order Field of Qvd ?.

Regards

Sunil