Changing Sort column

I have a report that has different groups and is sorted by a particular column.
I would like to be able to create an additional layout (in the trailer section) that executes the same query (in fact if it just uses the same data) but ordered by different column.
How can this be done?
I realise the lexical parameters could be used - how to do this via a trigger?
Is there another way.simplier that would not involve rerunning the same basic query.
The sort columns are in the detail and not group by columns.
Thanks in advance for any help and direction

I don't think that you can do this just by using one query. I mean same data twice but with different orders.
In that case you need another query and second report layout within same report. You already know, what is the sort order for query one and query two, so in that case you don't need lexical parameters (if you go by this way).
Another option is, run this report twice from JSP by passing sort column name to lexical parameter. It will create two PDFs but your report will have only one query.
Third and best option is, on JSP ask user on which column he/she wants to sort and pass this column to lexical parameter in report.
In your case, you don't need to set value for lexical parameter in form triggers. You can pass directly to lexical parameter from JSP.
May be someone else can give better solution.

Similar Messages

  • A simple question about wrong sorting with multiple sort columns in Excel 2010

    Hi, everyone! I have encountered a problem that I don't know how to explain.
    So I post it here because I don't know if there is another more relevant forum...
    I have a data sheet with the students' scores for the course. 
    All the data were generated with the randbetween function,
    and pasted with the values.
    To rank the students by their performance,
    I did the sort with the column "total score" as the first sort-column
    and "final term" as the second.
    The weird thing to me is that the order of the data seems problematic.
    That is, all the rows are sorted correctly with the first sort-column.
    But for the rows with the same values of the first sort-column,
    there are some rows whose values of the second sort-column are out of order.
    (please look at the data file at
    www_dot_kuaipan_dot_cn/file/id_67204268108546068_dot_htm
    Please change the "_dot_" to the real literal dot.
    Especially the rows with 56.7 as the first sort-column value
    and some other values near the tail of the list.)
    I tried to manually input and sort the same values of both columns
    in a near-by region. The result was correct.
    When some friend copied all the data to paste in Notepad,
    and reload them in excel. The problem disappears.
    Some friend also tried to wrap a round function at the values of the 1st sort-column,
    the sorting order became correct!
    But they could not explain why either.
    How confusing! I even tried to swap the first and secod sort-column;
    the output was right.
    All the data were generated by randbetween function and pasted with values.
    Where could all the special characters, if any, come?
    Can anyone give me an explanation? I would be very grateful.
    Thanks in advance!

    Re:  Sort is not in proper order
    Sounds as if the data includes spaces or hidden characters that are affecting the sort.
    That is indicated by the fact that manually entering the data resolves the problem.
    Note:  You can use a public file storage website to hold your file and add the link to it in your post.
    Jim Cone
    Portland, Oregon USA
    Special Sort excel add-in (30+ ways to sort) - 3 week no obligation trial
    https://jumpshare.com/b/O5FC6LaBQ6U3UPXjOmX2

  • Locking and sorting columns

    This is what I am trying to do:
    Lock the information in column A so it always stays there (1st, 2nd , 3rd, etc.)
    Sort Column C (total winnings) in descending order and keep the coresponding participants (column B ) with the amount.
    Create a value in Column D (4 behind Leader) that shows the difference between C3 and C4, C3 and c5, etc.
    The amounts and names are  filled from another sheet and change weekly. I can sort based on total winnings and the names follow. I can also create a formula to show the difference between the Leader and the next place participant however when I do a sort based on Total Winnings after the new values each week the Place and $Behind Leader always shift up and down. The information in Column A seems "locked" to the information in Columns B and C. The refernce in Column D is always Chris's amount and I want it to be refenced to the 1st place Participant.
    I hope I've explained this.
    Thanks - James
    2013 Standings
    Place
    Participant
    Total Winnings
    $ Behind Leader
    1st
    Chris
    $24.00
    2nd
    Ken
    $22.00
    -$2.00
    3rd
    Paul
    $20.00
    -$4.00
    4th
    Josh
    $18.00
    5th
    Kelly
    $16.00
    6th
    Greg
    $14.00
    7th
    Dave
    $12.00
    8th
    Darren
    $10.00
    9th
    Don
    $8.00
    10th
    Tony
    $6.00
    11th
    Suzanne
    $4.00
    12th
    James
    $2.00
    13th
    Spare 1
    $0.00
    14th
    Spare 2
    $0.00
    15th
    Spare 3
    $0.00
    16th
    Spare 4
    $0.00
    17th
    Spare 5
    $0.00
    18th
    Spare 6
    $0.00
    19th
    Spare 7
    $0.00
    20th
    Spare 8
    $0.00

    Hi j&s,
    Numbers uses a data base model that treats each row of a table as a single record. You can sort all or selected rows on the values in one or more column(s), but the whole row moves to maintain the integrity of each record.
    If you want some columns to be excluded from a sort, you need to remove those columns (or their data) from the table. Jerry has offered a way to do that for the rankings, but that solution will not resolve the issue of the 'leader board' cells acting badly in a sort.
    Here's an alternate. The first view is of the table(s) (with the participants in alphabetical order), just after the current totals had been entered.
    At this point, the Leader board, which pulls names and totals from the first three body rows of the data table, shows the correct cells, but these don't include the correct information.
    Note that column A does show the correct placing for each participant.
    The second view shows the same table(s) after the data table has bee sorted. The sort may be descending on column C (Totals) or ascending on column A (Place).
    Place is calculated from the Total values, using this formula:
    A2: =RANK(C2,C,largest-is-high)
    Fill down into the rest of the cells in column A. Any empty rows should be removed from the bottom of the table, or have zeros entered into their total column cells.
    The Leader board table has two formulas:
    A2: =OFFSET(Data :: $A$1,ROW()-1,1)
    Fill down to A4.
    This returns the name of the participant in the top body cell of column B of the data table.
    B2 contains the word "Leader"
    B3: =IF((OFFSET(Data :: $A$1,1,2)-OFFSET(Data :: $A$1,ROW()-1,2))>0,OFFSET(Data :: $A$1,1,2)-OFFSET(Data :: $A$1,ROW()-1,2),"Leader")
    Fill down to B4
    The root of this formula is OFFSET(Data :: $A$1,1,2)-OFFSET(Data :: $A$1,ROW()-1,2)
    This returns the total value from the first and second body cells in the total column, and subtracts the second from the first.
    The rest of the formula is an IF statement tohandle the occasions where there's a two or three-way tie for the lead. (image below) If the result is greater than zero, the subtraction is repeated and the result returned to the cell (B3); if the result is zero, the word :Leader: is returned to this cell.
    Placing the calculation in a separate table and using OFFSET, with a base cell (Data::A1) that is in a row defined as a Header row makes this table and its formulas immune from sorting of the Data table.
    Here's the tie, which arose when i added another 11 particpants to check sorting of the Place column:
    Regards,
    Barry
    Message was edited by: Barry (added image and notes on Tie case)

  • Sort column in advanceddatagrid

    Hi, i have an interesting question - how to sort column id
    datagrid, like i clicked on a header. I use AdvancedDataGrid and
    HierarchialData

    Yes, it works for HierarchicalCollectionView, but works for
    only first level of the tree. Like I sort an XMLListCollection,
    comparefunction handles only full elements of the first level. I
    need also to sort children nodes of the thee (customer wants).
    I have done it for XMLListCollection which is the source of
    HierarchialData but it's too many letters =)) and i need sort it
    and refresh HierarchialData after every change. Advanced datagrid
    makes it automatically by pressing on a header.
    Here is the code:
    quote:
    public static function
    sortXMLListCollection(xml:XMLListCollection,dataField:String):XMLListCollection
    var sorting:Sort=new Sort();
    sorting.fields=[new SortField(dataField)];
    xml.sort=sorting;
    xml.refresh();
    for each(var item:XML in xml)
    XMLUtils.sortXMLNode(item,sorting);
    return xml;
    public static function
    sortXMLNode(node:XML,sorting:Sort):XML
    var tempXML:XMLListCollection=new XMLListCollection(node.*);
    tempXML.sort=sorting;
    tempXML.refresh();
    XMLUtils.clearNode(node);
    XMLUtils.appendXMLListInXML(node,tempXML.copy());
    for each(var item:XML in node.*)
    XMLUtils.sortXMLNode(item,sorting);
    return node;
    public static function
    appendXMLListInXML(xml:XML,xmlList:XMLList):XML
    for each(var appendXML:XML in xmlList)
    xml.appendChild(appendXML)
    return xml;
    public static function clearNode(xml:XML):XML
    for(var i:int=new
    XMLListCollection(xml.*).length-1;i>=0;i--)
    delete xml.*
    return xml;

  • Change sort order

    I need to change the sort order for calendar field. Currently Week is displayed as 2012Week1, 2012Week2, .....2012Week10, 2012Week11, 2012Week20 ...2012Week52. If I sort in ascending order it sorted as 2012Week1, 2012Week10, 2012Week11.... 2012Week2, 2012Week20,..... which is not correct. It should be as 2012Week1, 2012Week2, .....2012Week10, 2012Week11, 2012Week20 ...2012Week52.
    The data type for the Week field is Varchar. Can we achieve the above sorting?
    ---MH

    Thanks David.
    If we put that formula then its changing the year to the current year i.e. 2012Week1 is changed to 2013Week01 which is not what I want. Also this might not be user friendly if they are doing ad hoc reporting as they need to go Week column and always change the formula.
    Also in RPD at sort column I gave the sort order as Day for the Week. But I am afraid that this might hit the Day level table whenever user tries to sort which will have performance implication.
    Any other suggestion?
    --MH                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Sorting columns in editor.

    Hi,
    I haven't found anything written so far on sorting columns by clicking on the column header in the data tab of the editor. I find that particular operation fro sorting very useful.
    Thanks.
    JC

    if you are looking at a result set from some SQL, then there is no sort buttons, functions, etc.. excpet for you to change the SQL. Be nice to be able to click on the data grid headers though, eh?
    If you are browsing table data via the DATA tab in th etables tabs, then you will see 'Sort...'. Click it to define your sort. You get to this by clicking on a table name. Be nice to be able to click on the data grid headers though for simple one attribute sorting, eh?
    DK

  • ALV - add colour to columns, sorting columns

    Hi Experts,
    Using ALV oops......I am using field catalog merge FM.
    After using that how do I use color & sort options.
    How to add colors to columns
    How to sort columns
    Thanks in advance.
    Edited by moderator to more meaningful title

    Hello Ravindar
    Of course you can use the colouring options:
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      * I_BUFFER_ACTIVE =
        i_structure_name = 'ZSHHR207'
        * I_CLIENT_NEVER_DISPLAY = 'X'
        * I_BYPASSING_BUFFER =
        * I_INTERNAL_TABNAME =
    CHANGING
    ct_fieldcat = it_fdcat
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    DATA: ls_fcat     TYPE lvc_s_fcat.
      LOOP AT it_fdcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN '...'.
             ls_fcat-emphasize = 'C410'.
          WHEN '...'.
             ls_fcat-emphasize = 'C600'.
          WHEN OTHERS.
             CONTINUE.
          ENDCASE.
        MODIFY it_fdcat FROM ls_fcat INDEX syst-tabix.
      ENDLOOP.
    Regards
      Uwe

  • Change sorting in Finder from ascending to descending and keyboard shortcut

    Hallo,
    can someone point me in the right direction of how to change sorting in Finder from ascending to descending and what are the corresponding keyboard shortcuts?
    I am already using the ctrl-cmd+number key shortcuts to modify my sorting, and a Google search produced the answer that I can change from ascending to descending by hitting the key-combination again. But it does not work ...
    Any help ;-)  ?
    Thank you !

    Never heard of a keyboard command to toggle the sort sequence from ascending to descending and back.
    The usual way to change it is to click the highlighted column name in the Finder window.

  • IMac; 10.9.2: Mail: lost scroll bar in sort column and mail

    right side scroll bar is missing both in sort column and when viewing an individual email from main screen.....
    HELP

    mskathk wrote:
    Did this setting change with one of the updates?
    Yes.

  • The 'sort columns' default behavior

    It seems the new sort columns remove the word "The" by default in a title listing. I'm curious to know if this action can be removed.
    Also, since it is apparently possible to pre-program sort column behavior, is it possible to always reverse to lastname, firstname in the sort composer column?

    I just thought since iTunes now comes pre-programmed to alphabetize without the "The" first, it might be possible to revert it to original behavior.
    I don't know if it's something that can be reverted, short of going back to a previous version of iTunes or finding something (a script?) to strip the entries in the Sort Name field for those songs.
    Looking at the tracks in my Library, it seems that at the point of updating, iTunes went through and stripped the initial 'The' from all the song titles and placed that in the Sort Name field. Tracks that don't start with 'The' and maybe similar articles like 'A' (I can't think of any in my library to check) do not have anything in the Sort Name field, and are thus sorted normally by the full title.
    The behavior of the program hasn't changed, but the song data that it operates on has.
    WRT iPod and contacts- last name and first name are two different fields in the contact information- the same switch is possible in AddressBook. But (and this is a BIG but) if, when entering the contact into AddressBook, you enter the full name into one field-either First Name or Last Name- you cannot change the order.
    What the iPod is doing is the same as you clicking another column heading in iTunes.

  • Sort columns in matrix report

    Hi all
    I create matrix report( in version 9i)
    I want sort columns of report
    when i use order by it sort rows but i want sort columns
    my query is like this:
    SELECT
    Code,
    name,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E') Activity,
    SUM(amnt) amount
    From Mytable
    Where ....
    group by
    Code,
    DECODE(cons_code, '1', 'A',
    '2', 'B',
    '3','C',
    '4', 'D',
    '5', 'E')
    my group base on code
    my columns base on Activity
    and cells are Amount
    my report result is:
    ........ B E D A C
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    I want this :
    ........ A B C D E
    name1 1 1 1 1 2
    name2 3 4 8 6 1
    ....

    Hello,
    How about this?
    SELECT Code, name,
    DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D','5', 'E') Activity, SUM(amnt) amount
    From Mytable
    WHERE ....
    GROUP BY Code, name, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')
    ORDER BY code, DECODE(cons_code, '1', 'A', '2', 'B', '3','C', '4', 'D', '5', 'E')

  • Change download columns from report

    Hi! I have a report, with some columns and I'd like to change the columns when downloading as csv file.
    Let's say that I have a report with col1,col2, col3,col4 and some hidden columns: col5, col6, col7. When I download the file I'd like to have only
    col2, col3, col6, col7.
    How can I do this?
    Thanks!

    Currently there is no way to do this. The CSV export function just re-runs the exact same report as you see it on the screen and transforms it to CSV format.
    Another option is to create a report with the columns you want in the CSV on another page, and use the export:CSV template as in
    http://tinypic.com/jzya2t.jpg
    and provide a link to that page. This will run that page and instead of showing the page it will popup the File download box.
    Hope this helps.

  • How to change the column value which is coming from DO by a calculated field?

    Hi all,
    I want to change a column value based on my calculated field value. I have a column which is coming from DO which is based on External Data Source. I have a calculated field in my report. When there is any change in the calculated field then the column which is coming from DO needs to be changed. It means the DO needs to get updated when there is a change in the calculated field. Or like if the calculated field meets some condition then I need to change/update the same in the DO. This has to be done on the fly. the report should not submitted for this. when there is a change in the calculated column the DO column needs to get updated.
    Thanks,
    Venky.

    Ok, I've been a customer for very many years, I'm on a fixed retirement
    income.  I need to reduce my bills, my contract ends in  Dec. I will be
    pursuing other options unless I can get some concessions from Verizon.  My
    future son-in-law was given this loyalty plan, so I know this is a
    reasonable request.  My phone number is (removed)  acct number
    (removed)
    >> Personal information removed to comply with the Verizon Wireless Terms of Service <<
    Edited by:  Verizon Moderator

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • How can I change excel column header using Labile.

    Dear Experts,
                          How can i change excel column header using LabVIEW.
    Thanks for any and all help!
    M.S.Sivaraj.
    Sivaraj M.S
    CLD

    As I said in my previous post, column headers in Excel are merely row 1 cells. May be I missing something here, so please be more explicit with your question.
    I guess you are using the Excel Report tools, and you want to modify an existing sheet. From my limited experience with the Excel Report tools, it is not possible to open an existing woorkbook (except as template...), so the answer to your question should be "Forget it"...
    The work around is to use the example I pointed for you before, and either to write the whole new colum headers as a string array, starting in A1, or to write a single string to a given cell in row 1.
    Hope this helps 
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

Maybe you are looking for

  • Video Quality worse in new version?

    Ok, so I had the settings down pat in the last version of imovie and idvd. I imported my miniDV footage in widescreen format into iMove and then ported it over to iDVD. I used to use the "Best Quality" feature in the last version but changed it to "P

  • Adding panel to scrollpane on button click

    Please run the below code with javac MyTestingNew.java and java MyTestingNew I am having a button(ADD ME) on click of that I want to add panel containg textfield which will append to already exist textfields which are diasplyed in jscrollpane How I c

  • File extension not showing after a clip has been captured

    Hi , I am using Adobe CS6 and am capturing in DVCAM format as soon as a clip is being captured , a new project is created with the captured clip in that But the issue is i am not able to get the file extension for ex: if you right click on that new c

  • How to load the big raster data in georaster?

    Hi anyone, I have 1024G raster data ,I just ask how can I load the data, let it's performance so that it will not be affected by the large data?

  • WM Tab in MIGO

    Dear All, i am doing MIGO for a PO for a material having warehouse management view also, but WM tab is not appearing while i am doing to GR for PO. Regards, qsm sap