Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Vinni2000
Contributor III
Contributor III

Sort the data using timestamp

I have data in Qvd now I want to load that data into my report using data load editor so I want to sort this data in data load editor using timestamp 

 Timestamp format : 2023-08-14 14:14:26.020000

7 Replies
marcus_sommer

Try it with:

t1: load * from qvd;
t2: noconcatenate load * resident t1 order by timestamp;
drop tables t1; 

Vinni2000
Contributor III
Contributor III
Author

Not working not sure why 

marcus_sommer

What happens? Any error or unexpected results? Did you apply the suggestion closely or with any adaption? Means you should share some more details, like a few input- and output-records - with the current and the expected results as well as the relevant script-parts.

Vinni2000
Contributor III
Contributor III
Author

Here I have data like this in qvd

Po , req_type , req_timestamp

1 ,change , 08-08-23 09.20.40.450000 AM

1, create ,08-08-23 09.18.20.100000 AM

 

So I am contacting those req_types based on po

Po , re_type 

1, create,change

 

Here create should be first as it is created first you can observe this in timestamp 

marcus_sommer

It should work as described above if the timestamp is really a timestamp which means it's a numeric value with a formatting. Further you will probably need to include other key-fields within the order by statement.

If the timestamp-field is instead a string you will to convert it to a timestamp per timestamp#(Field, Format). The specified format-patter must absolutely identically to the data. You may need some attempts to find the right ones. Helpful might be also to cut the string and convert the single parts and adding them again. All this should be already applied in the script which creates the qvd and maybe even the sorting might be done there. 

Vinni2000
Contributor III
Contributor III
Author

No , while concatenating the distinct req_types  Qlik by default sorting this re_type that's i am getting change first then create second is there any way to avoid this

 

Timestamp is perfect timestamp 

marcus_sommer

Concat() has a third numeric parameter which will sort the result - and here you could apply the timestamp.