Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

­Why is sorting not possible while loading QVD?­

Hi,

     Anyone please tell me.

Regards,

Devi

5 Replies
its_anandrjs

In any resident load you can sort the QVD with Order BY clause

Ex:-

QVDTab:

Load

Field1,Field2,Field3

From QVD Location;

Noconcatenate

New:

Load

Field1,Field2,Field3

Resident QVDTab

Order By Field2,Field3;

Drop Table QVDTab;

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);

Noconcatenate;

Data:

LOAD

     *

RESIDENT TempTable

ORDER BY Field1, Field2;

DROP TABLE TempTable;

Hope this helps you.

Regards,

Jagan.

Anonymous
Not applicable
Author

Hi

Order by is not directly supported. One of the reasons I see, is that order by clause may affect performance considering large amount of data in teh source.

As Jagan has pointed out, we can work on resident table to apply order by.

puttemans
Specialist
Specialist

Hi Devi,

As you are loading data, the program does not know the nature and the size of the data you're loading, therefore it cannot sort. Once the data are 'known' to Qlikview (loaded in), then you can sort them. That's why you cannot sort while loading.

tresesco
MVP
MVP

Think it this way:

Suppose, you are requested to arrange a few names alphabetically. Now I give you names one by one. When you get the first name you can't put it in an arranged way because you don't have the reference to compare the name with; where you should place that name. The arrangement approach is only be possible when you know/have all the names. Similarly, qlikview loading records are like getting data one by one. So qlikview would only be able to sort them when all values are loaded/available in the memory.

I guess, alternate could have been possible, but that could be costly in terms of memory utilization, hence QlikView avoids that.

hope this helps.