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: 
Simon_BI
Contributor II
Contributor II

Order By multiple dimensions

Hi Friends,

I have input data like below. 

And i wish to have the desired output to load the data order by product and meanwhile the product with Exception "Y" is loaded firstly. The desired output can be found as below.

Attached QVW file you can use to work with. Appreciate if someone can help me here ?

Input data:

Product, DC_NO, STO_NO, DC_QTY, STO Needs, Exception
00169560, DCGACN, 001, 200, 8, N
30234229, DCGAPAU, 003, 20, 10, N
30234229, DCGAPAU, 004, 20, 10, N
00169560, DCGACN, 002, 200, 8, N
00169560, DCGACN, 020, 200, 8, N
00169560, DCGACN, 021, 200, 16, N
00169560, DCGACN, 022, 200, 16, Y
60185269, DCGACN, 028, 20, 24, N
00169560, DCGACN, 023, 200, 8, N
00169560, DCGACN, 024, 200, 8, Y
00169560, DCGACN, 025, 200, 8, N
00169560, DCGACN, 026, 200, 8, N
30234229, DCGAPAU, 005, 20, 10, N
00169560, DCGACN, 027, 200, 16, N
00169560, DCGACN, 028, 200, 24, N
30234229, DCGAPAU, 001, 20, 10, N
30234229, DCGAPAU, 002, 20, 10, N
30234229, DCGAPAU, 007, 20, 10, N
30234229, DCGAPAU, 008, 20, 10, Y
30234229, DCGAPAU, 010, 20, 10, Y
60185269, DCGACN, 027, 20, 16, Y
30234229, DCGAPAU, 006, 20, 10, N
30234229, DCGAPAU, 009, 20, 10, Y

Output:

00169560DCGACN02220016Y
00169560DCGACN0242008Y
00169560DCGACN0012008N
00169560DCGACN0022008N
00169560DCGACN0202008N
00169560DCGACN02120016N
00169560DCGACN0232008N
00169560DCGACN0252008N
00169560DCGACN0262008N
00169560DCGACN02720016N
00169560DCGACN02820024N
30234229DCGAPAU0092010Y
30234229DCGAPAU0082010Y
30234229DCGAPAU0102010Y
30234229DCGAPAU0072010N
30234229DCGAPAU0012010N
30234229DCGAPAU0022010N
30234229DCGAPAU0032010N
30234229DCGAPAU0042010N
30234229DCGAPAU0052010N
30234229DCGAPAU0062010N
60185269DCGACN0272016Y
60185269DCGACN0282024N
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Order By Product asc, Exception desc, STO_NO asc;

View solution in original post

4 Replies
tresesco
MVP
MVP

Try like:

Order By Product asc, Exception desc, STO_NO asc;

Simon_BI
Contributor II
Contributor II
Author

Hi Tresesco,

I tried your solution in the attached QVW file. But it doesn't work.

The output is not as i expect.

tresesco
MVP
MVP

Hi Simon,

If you want to see the actual data in which order it was loaded, you can go to the data model and preview the data or in table box, you have to sort it properly i.e. by 'Load Order' .

Capture.PNG

Simon_BI
Contributor II
Contributor II
Author

Hi Treseco,

Yes, you are right. The back end table is in correct sequence and by sorting properly i get what i want now.

Thanks for your help.