Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

order by doesn't work

Hi!

if i do


load time,number

resident table

order by time;

(time is numeric)

my table doesn't order by time but it is oder randomly.

13 Replies
MVP
MVP

order by doesn't work

When you say "my table", do you refer to the table you could look at in table viewer or do you create a chart table object using fields time and number?

If second, I guess the sort order for those fields within the object is not set to load order of field time, but something different.

Not applicable

order by doesn't work

i refer to the table i could look at in table viewer

MVP
MVP

order by doesn't work

Could it be that you get a concatenation to a table with fields time and number (maybe table "table"?) and you are still looking at the original order of table "table" (table view will only show you the start of the table)? Try a NOCONCATENATE LOAD then, using a label for your new table and a drop the first table (or rename the fields).

Not applicable

order by doesn't work

I already use NOCONCATENATE

MVP
MVP

order by doesn't work

Could you post a small sample here (upload availabe in advanced editor)? Or your script?

Not applicable

Re: order by doesn't work

of course!

DDSEvent_Signal2:

LOAD 

     VehicleName,

     VehiclesKey,  

     EventId,

     ProcessId,

     StartTime,

     EndTime,

     MCGFileNameId, 

     EnvironmentSignalGuid,

     central_sample

from ./file.qvd(qvd);

DDSEvent_Signal:

QUALIFY*;

UNQUALIFY VehiclesKey,MCGFileNameId,DiagnosticConfigurationId/*,DDSEventId*/,EnvironmentSignalGuid/*,central_sample*/,VHLKey,StartTime;

NoConcatenate

LOAD 

     VehicleName,

     VehiclesKey,  

     EventId,

     ProcessId,

     StartTime,

     EndTime,

     MCGFileNameId, 

     EnvironmentSignalGuid,

     central_sample

resident DDSEvent_Signal2

Order By StartTime;

drop Table DDSEvent_Signal2;

MVP
MVP

order by doesn't work

Are you doing something later on in your script with this table?

Have you tried not using the Qualify / Unqualify (just exiting the script after the second load, just for a test)?

Could you give an example of how your table looks like not correctly ordered?

It is probably be helpful if you could post a small sample, if you don't want to post confidential data, maybe you can use mock up data or scramble it.

Not applicable

Re: order by doesn't work

attached below my startTime column order by load order

Thanks!

MVP
MVP

order by doesn't work

Thanks, that's what I call a big example

But I was more after a sample of your input data (qvd) and your complete script (maybe just a little qvw sample?).

Honestly, I still don't know why you don't get an ordered startTime field. I would try and keep the codes as simple as possible to see what's going on.

Community Browser