5 Replies Latest reply: May 15, 2014 9:59 AM by Greg Goodman RSS

    Sorting Oddity

    Greg Goodman

      I have a model where the sort order in the summary has 2 items not sorting correctly.

       

      the field is the 9th Item in Keys and the 1st numeric key used only for sorting . There are 318 lines in the summary and all lines are sorted correctly except for this pair of lines (Line 296 should be at line 295)...

       

      Any Ideas ?

        • Sorting Oddity
          Bruce _

          Greg

           

          Is it possible you have embedded non-visible characters within the string? (like ascii 1-60 or so)

           

          To check quickly list the len() of the string. If have a problem you might have to use prep.exe or msrp.exe (both are on the CD) to get rid of these nasty charatcters.

           

          Bruce

          • Sorting Oddity
            Greg Goodman

            Bruce, the "source" data is actually output from 2 Monarch models into a temporary text source. The

            number that isn't sorting was built using the RECNO() function...

            • Sorting Oddity
              Greg Goodman

              Bruce, hadn't heard back...

              • Sorting Oddity
                Grant Perkins

                Greg,

                 

                This is likely to be a bit tricky to advise on unless someone has had the same problem and identified a bug somewhere - which seems not to tbe the case at the moment.

                 

                RECNO() is a variable number allocated to the table row numbers. So if you have previously combined 2 reports into one have you used RECNO on the original reports and saved the values in the exported combined file (as a named field) or are you using RECNO as a function in your current model? If it's the current model the only diagnostic options would seem to be that the sort is set to ascending instead of descending or vice versa OR a sort at another level prior to the RECNO sort is the cause but does not give an obvious display of data to bring your attention to it.

                 

                I hope this provides a few ideas. The alternative is to shares the combined 'report' and its model with anyone prepared to  have a look and see if we can spot anomaly. Would that be an option?

                 

                Grant

                 

                 

                Originally posted by Greg Goodman:

                Bruce, the "source" data is actually output from 2 Monarch models into a temporary text source. The

                number that isn't sorting was built using the RECNO() function... /b[/quote]

                • Sorting Oddity
                  Greg Goodman

                  Grant, I can certainly recreate the the report, transition report, and models. I can't recall at the moment where Recno() was being applied. What I can tell you is that in the final summary where

                  this was happening, there were around 400 rows

                  and sorting using the field in question as a key

                  field was perfect from like 1 to 256, 257 & 258 were reversed, and 259 > 400 sort was perfect.

                  Go figure.

                   

                  If somebody wants to take a look, I'd be happy to supply. I've been using Monarch since 1.0 and have seen a few bugs during 13/14 years but this was a new one...