Sort report based on variable XYZ

bluesoulcurrybluesoulcurry Member Posts: 25
I have created a report using Integer temporary table. I get all the data that I need to show in the report by inserting data in temporary tmpItem table. Now, I have a variable XYZ which is calculated dynamically using two flowfields of tmpItem table.

My requirement is to sort the report data of tmpItem table based on the variable XYZ in descending order. i.e. the line with highest value of XYZ should come on top. I referred to other posts, that says I should create XYZ as a key in the temporary table \. I don't know how can I add XYZ to the key of temporary table.

Thanks in advance.

Comments

  • navuser1navuser1 Member Posts: 1,329
    I have created a report using Integer temporary table. I get all the data that I need to show in the report by inserting data in temporary tmpItem table. Now, I have a variable XYZ which is calculated dynamically using two flowfields of tmpItem table.

    My requirement is to sort the report data of tmpItem table based on the variable XYZ in descending order. i.e. the line with highest value of XYZ should come on top. I referred to other posts, that says I should create XYZ as a key in the temporary table \. I don't know how can I add XYZ to the key of temporary table.

    Thanks in advance.

    Check Report ID 711 Inventory - Top 10 List
    or Report ID 111 Customer - Top 10 List
    Now or Never
  • bluesoulcurrybluesoulcurry Member Posts: 25
    Hi Navuser1,

    Thanks for your reply. But the reports that you have mentioned uses a whole new thing for me. Excel Buffer. There should be another way to do it without using Excel Buffer as I have seen in other posts.

    Regards.
  • SogSog Member Posts: 1,023
    a temporary table is a "copy" of the actual table, if you want to add a key, you should do so in the actual table.
    However, if you can sort the way how records are inserted into your temporary table, then you don't have to add a key.
    I would use a temporary journal table, and use the line number to sort my dataset.
    then I would insert my records based on the autosplitkey.
    item  |  XYZ  |  Line No.
    A      |  50    |  10000
    B      |  30    |   20000
    C      | 60     |   5000
    D      | 25     |   30000
    E      | 80     |  2500
    F      | 55     |  7500
    G      | 28     |  25000
    
    Sorted on line number I would have E 80, C 60, F 55,A 50, B 30, G 28 , D 25
    worst case is that the first record would be the last and all the following line numbers will be < 10000, it is a case you might want to take into account.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
Sign In or Register to comment.