Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
wuming79
Contributor

Order by during data loading

Hi,

How do I actually do order by during data loading? 

Reference from https://community.qlik.com/t5/New-to-Qlik-Sense/How-to-sort-data-in-data-load-editor-and-assign-orde...

I tried:

 

 

LOAD datetime,

RESIDENT MyTable

ORDER BY datetime DESC;

 SELECT datetime

FROM MyDB.MyTable

But the following lines were highlighted in red.

 

RESIDENT MyTable

ORDER BY datetime DESC;

 

Labels (2)
4 Replies
MVP
MVP

Re: Order by during data loading

Assuming your MyTable is properly labelled before it is being referred in resident load, you need to remove ',' (comma) after field name in load statement.

 

Otherwise try loading the table from db using SELECT first and then use RESIDENT load like:

MyTable:

Select ... from <>;

NoConcatenate

Final:

Load ... Resident MyTable Order By <Field> Desc;

Drop table MyTable;

nasirsaikh
Contributor

Re: Order by during data loading

Qlik only allowing order clause in Resident only

wuming79
Contributor

Re: Order by during data loading

Hi,

I did the following but qliksense gave the error  "Table 'OV_stati' not found"

[MyTable]:
LOAD data AS data1, 
timestamp AS timestamp, 
timestamp((timestamp/86400 + 25569 + 8/24),'DD/MM/YYYY h:mm:ss[.fff] TT') as datetime,

Resident [MyTable]
ORDER BY datetimeDESC;

SELECT `data `, 
`timestamp`, 
`datetime`, 

FROM MyDB`MyTable`;
timpoismans
Valued Contributor

Re: Order by during data loading

When doing a Resident load, always at a "NoConcatenate" to the load. Else you risk the table getting auto-concatenated to the one it's being loaded from.

 

Regards,

Tim P.