AnsweredAssumed Answered

Sort Order fails the second time after Run

Question asked by teodora_popoaca on Oct 26, 2018
Latest reply on Nov 1, 2018 by gdurniak

Hello everyone,



I am doing a top10 sales report with a summary based on Sales Data (Big Database), between a Start and an End date.

There are multiple sales Criteria that i need to search for in my data-set (between Start and End Date) and create a top 10 with sold products for every criteria (think different lines of products).


In order to do so ... i loop through an instructions list which holds the definitions and search parameters for each criteria and produce various sub-sets which i then import into a Report table. Once there, i sort my records by total sales of my products (high to low) and loop through my records, omitting the first 10, and then i show omitted. I have a report page that i formatted with sub-summary parts in order to show my records in a fancy way. And then i append this page to my report PDF.


Additionally, i import these 10 records with information regarding from which statistics (criteria) they come, into a Summary table. Basically, at the end of each loop run i dump these 10 records there.


After my loop is finished and i have the big report (with pages for each criteria), i go to the Summary report page (with other sub-summary parts) where i want to create a smaller version of the big report with all the top10s. Here the idea is to have a compact 2 pager with all my top 10s. In order to do so, I then sort by 5 fields, and the page is formatted so that it spreads over 5 columns.



The problem now is, that the first time i run this script, everything works perfectly. But the second time around, the sort in the Summary table doesn't work anymore. And i don't understand why.


These reports need to be created for a number of countries our firm operates in, therefore i have a master scrip that triggers in a loop this process of report creation. And for the first country i get my summary. But for the second one .. it simply doesn't want to show anything.


In Script Debug, the second time around, it all happens when i go through the Sort Records Script Step, but having worked the first time, i don't understand why doesn't it work the second time. I make sure to clear any globals i have between each report, so i basically start the same way every time, for all the countries.


And something else to mention, i tried to sort manually it doesn't work either. I get sent to a record 0. And i cannot use the record arrows to move through them. Even if i drag the record handle to a record 200, it goes back to 0.

And it keeps happening again and again. First time works, second time it doesn't. What i am doing wrong? (does it help to say that it was working the day before?:P)


A colleague suggested to compact my file and try to recover, but it said in the recovery log, that there were no issues. Completely lost.


See attached pictures.

1. Backstory - Visual (Shows the report creation for one Run - Country)

2. Summary Layout

3. Succeeded Sort (Expected result) - it's from the resulting PDF, but it would look the same in Preview mode after a succeeded sort.

4. Failed Sort - with the sort criteria. Page Num is used to keep the statistics in the same order as in the big report, and Sum is used to order my products from high to low. But i only show Report Criteria (Country Name), Stat_Name (the general search criteria for those top 10) and model-color-temple (the product lines, or colors or whatever sits in that top10.


Thank you for taking the time to read my novel.