Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Order by problem

Hi,

I need to order a qvd file by two fields, but it seems impossible. I'm sure, I'm making some mistakes but I don't know where.

See below:

MYTABLE:

LOAD MyField,

     MyfieldSequence

    

FROM

[..\..\..Myfolder\Mytable.qvd]

(qvd) ;

Mytable1:

NoConcatenate

load *, 1 as newflag

resident MYTABLE order by Myfield asc, MyfieldSequence desc;

drop table MYTABLE;

It's very simple, but I don't see my data listed in the right order.

Help please !!

5 Replies
Not applicable
Author

Hi

Get thru the properties "Sort" and tick the sort by load order "original "

Christian

Anonymous
Not applicable
Author

Hi Christian, thanks for your answer.

I would sort data in the script without using sort properties tab in my objects.

Is it possible ?

er_mohit
Master II
Master II

try this

firstly load your table

MYTABLE:

LOAD MyField,

     MyfieldSequence

   

FROM

[..\..\..Myfolder\Mytable.qvd]

(qvd) ;

load

MyField,

     MyfieldSequence

resident MYTABLE

order by Myfield asc, MyfieldSequence desc;

load

MyField,

     MyfieldSequence

resident MYTABLE;

drop table MYTABLE;


i can't get you exactly if you attached data file then i understand clearly....

Not applicable
Author

hi

try this, hope it helps you.

tab1:

LOAD myfield,

     myfieldseq

FROM

(ooxml, embedded labels, table is Sheet1);

tab2:

NoConcatenate

load *, RecNo() as newflag  

resident tab1 order by myfield asc, myfieldseq desc ;

drop table tab1;

Not applicable
Author

Yes I understand,

It seems you sort is right but to see how exactly it is loaded you have to display and sort it by original load order.

When then you checked it is well loaded you are sure you can work in your script on a table sorted as you want. For example, you can you previous, peek...

Christian