Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulhv1
Creator II
Creator II

Order by not working (posting the same msg.with attachment)

Hi gurus,

below is the simple code I am having

TAB1:

load NO, NAME,MARKS FROM D:\TRIAL.XLS (ooxml,embedded labels, table is Sheet1);

Noconcatenate

ABC1:

Load NO, NAME,MARKS  resident TAB1 Order by NAME;

drop table TAB1;

In result I found that Order by clause do not work. I have tried different combinations i.e. NO , NUM(NO) , NAME but it doesn't work.

  1. Pls. suggest me the solution
9 Replies
anbu1984
Master III
Master III

If you want to order on Name in Tablebox, you can specify Ascending order in sort tab on Name

its_anandrjs

It is working try to click on Ctrl + T and see the difference.

1. Once load without the order table and see Ctrl + T.

2. Then add the Order table and then see Ctrl + T

You see there is order by try to load data in the table with sorted order

Or you can do by adding RecNo() as Rec

NoConcatenate

ABC1:

LOAD NO,NAME,MARKS,RecNo() as Rec  Resident TAB1 Order BY NAME;

DROP TABLE TAB1;

See this two difference

Without order by

NoOrder.png

With OrderBy

OrderBy.png

See the Name order in both loads.

Regards

Anand

tresesco
MVP
MVP

What makes you think that it is not working? Goto Table Viewer(Ctrl+T) and see the preview, it would show you the internal table view:

Screen Shot 12-05-14 at 04.09 PM.PNG.png

It is working.

rubenmarin

Hi Rahul, I think it's working, if you add a rowNo() to your load script you can see the order is OK:

TAB1:

LOAD NO,

     NAME,

     MARKS

FROM

[.\TRIAL.xlsx]

(ooxml, embedded labels, table is Sheet1);

ABC1:

NoConcatenate LOAD NO,NAME,MARKS,RowNo()as RowNumber Resident TAB1 Order BY NAME;

DROP TABLE TAB1;

In the 'Sort' tab of the object you can set how you want to sort. maybe you are sorting by loading order, it this case the loaded order for the NAME field is the order loaded in TAB1, in you want the load order to be the order of ABC1 you need to change the name of the field, ie:

AB1:

LOAD NO,

     NAME as UnsortedNAME,

     MARKS

FROM

[.\TRIAL.xlsx]

(ooxml, embedded labels, table is Sheet1);

ABC1:

NoConcatenate LOAD NO,UnsortedNAME as NAME,MARKS,RowNo()as RowNumber Resident TAB1 Order BY NAME;

In this case NAME has a load order from ABC1 table.

Hope I explained.

rahulhv1
Creator II
Creator II
Author

In preview,it  is working  fine, but when I put the out put as simple table box , it is not giving desire result even if IN SORT TAB, I REMOVED EVERYTHING , ALSO TRIED CHAINGING SORT BY LOAD ORDER, BUT IT DIDNT WORK.

rubenmarin

Hi, I attacch your qvw sort alphabetical, and another table without sorting but different field, so to original sort order is the ORDER BY clause.

Not applicable

Hi Rahul, When you do a table box - it just sorts based on whatever field is first (See the 'Sort' tab of the Properties). Just promote the 'NAME' field as first one and select 'Text' as Ascending or 'Load Order' as original (since the order has already happened while loading).

Hope this solves your issue.

its_anandrjs

Hi rahul,

Please open single thread for the same problem it makes confusing see this thread it is same.

Re: order by not working

Try this way and make this settings in the table box remove all sort settings in the properties and use only load order after order by for all fields and also try to load like in this sequence Name,No,Marks.

TAB1:

LOAD

      NAME,

      NO,

      MARKS

FROM

TRIAL.xlsx

(ooxml, embedded labels, table is Sheet1);

NoConcatenate

ABC1:

LOAD NAME,NO,MARKS,RecNo() as Rec  Resident TAB1 Order BY NAME;

DROP TABLE TAB1;

sortload.png

Regards

Anand

rahulhv1
Creator II
Creator II
Author

Thank you so much all of you, its working fine, only the thing is that it wasn't displaying in the table box. Thanks a lot again to all of you