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: 
robert99
Specialist III
Specialist III

Order By doesn't work


Hope someone can help me on this

I have set up incremental load

But this loads the records in a different order

I tried to rectify this (as I need to do a lastvalue)

So I tried to sort this by various order

None work. I have loaded the script below (Call_Num and FSR_Num are both numeric)

Thanks

left keep (SCCall)
LOAD

FSR_Call_Num as Call_Num,

FSR_Num,

etc
AutoNumber   (TEXT (Upper (FSR_Ser_Num)) & '/' & TEXT (UPPER (FSR_Prod_Num))) as SerialandProdNo,       if (ApplyMap ('RepCodeAdj',FSR_Call_Num,'Missing')='Missing',FSR_Rep_Code,   ApplyMap ('RepCodeAdj',FSR_Call_Num,'Missing')) as RepCode,     


   AutoNumberHash128  ( FSR_Call_Num , FSR_Ser_Num , FSR_Prod_Num) as CallSerial//new  ifNUM( ApplyMap ('WARRENDMAPP',AutoNumber ( TEXT (Upper (FSR_Ser_Num)) & '/' & TEXT (UPPER (FSR_Prod_Num)))  ,'NoCode')) >

  NUM( ApplyMap ('Callindate', FSR_Call_Num  ,'NoCode')) ,'YES','NO') AS CallInWarr

  resident SCFSRTess
where not Match (FSR_Employ_Num, '039') and not match  (FSR_Rep_Code,'09',9)
order by FSR_Call_Num ,FSR_Num          //FSR_Last_Update

;

1 Solution

Accepted Solutions
maxgro
MVP
MVP

I think you have to resident load your final table (SCCall ?) another time to order it

View solution in original post

3 Replies
maxgro
MVP
MVP

I think you have to resident load your final table (SCCall ?) another time to order it

robert99
Specialist III
Specialist III
Author

Thanks Massimo

I will try when I get to work. I have tried order by a number of times. It works at times but often I have had to find another way of doing what I wanted to.

Its possible that left keep and order by conflicts.

robert99
Specialist III
Specialist III
Author

I eventually used

load

Call_Num,

firstsortvalue (distinct FSR_Call_Num , - FSR_Num) as LastFSRNum

resident   TABLE GROUP BY Call_Num;


This worked and did not need to sort


But I think the answer above (Massimo's) was correct