13 Replies Latest reply: Oct 16, 2013 8:42 AM by Stefan Wühl RSS

    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.

        • order by doesn't work
          Stefan Wühl

          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.

            • order by doesn't work

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

                • order by doesn't work
                  Stefan Wühl

                  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).

                    • order by doesn't work

                      I already use NOCONCATENATE

                        • order by doesn't work
                          Stefan Wühl

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

                            • 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;

                                • order by doesn't work
                                  Stefan Wühl

                                  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.

                          • order by doesn't work
                            Sokkorn Cheav

                            Hi Davide,

                             

                            I really don't get your point, but maybe you need to view order in table viewer. If so then we ask this question:

                            1. Why I need to view order in table viewer?

                            2. If I can sort order in table viewer, what is the benefit for developer? What is extra load time and process when use order by?

                            3. Our customer need to sort order in table viewer or in QlikView object (Straight Table, Pivot Table,...)?

                             

                            So from my idea is do not sort order in load script. I prefer sort order in QlikView object.

                             

                            Regards,

                            Sokkorn Cheav