Sorting Crosstab Header

(5 posts) (3 voices)
  1. nsepetys, Member

    Hello myDBR Representative,

    How's it going? Is it possible to sort the crosstab header (shown by using the dbr.crosstab.header command) like by using a command similar to dbr.crosstab.col? If there's no direct way to do this do you guys have any work around ideas?


  2. myDBR Team, Key Master

    There is (an undocumented) command dbr.crosstab.header.col which works like dbr.crosstab.col.

    myDBR Team

  3. nsepetys, Member

    Beautiful! I should have just taken a stab at the command to see if it was undocumented. Can we document that so others can benefit from it? Thanks for your help!

  4. john, Member

    on my report this isn't sorting.
    When i run with &export=sql i can see the order of the dbr.crosstab.header.col which is correct but the crosstab is in a different order

    selection from when run with &export=sql

    Begining of Report
    select ''; select 'dbr.subtitle', 'Income/expense.'; select 'dbr.crosstab', 'yeardate'; select 'dbr.sum', 'Amount'; select 'dbr.hsum', 'Amount'; select 'dbr.hidecolumn', 'Accounttype'; select 'dbr.summary.options', 'skip_single_line_summary'; select 'dbr.keepwithnext'; ;

    select 'dbr.crosstab.header.col', '2024 2' union all select 'dbr.crosstab.header.col', '2019 9' union all select 'dbr.crosstab.header.col', '2019 8'

    begining of crosstab
    select 'Automotive Fuel 8110' as 'Account', '2015 9' as 'yeardate', 5 as 'Accounttype', 20.0 as '[Amount]' union all select 'Automotive Fuel 8110', '2015 8', 5, 67.82 union all select 'Automotive Fuel 8110', '2015 7', 5, 9.75 union all select 'Automotive Fuel 8110', '2015 6', 5, 20.0 union all

  5. myDBR Team, Key Master

    to set the order for crosstab columns, use the 'dbr.crosstab.col' commmand. See documentation.

    The dbr.crosstab.header.col-command is used to define the order of the 2nd level headers defined by the dbr.crosstab.header.

    myDBR Team


You must log in to post.