Sorting dbcross by grandtotal

Is it possible to sort a dbcross according to the grandtotal column?
Im using FR 3.24

Greetinx,

Jos

Comments

  • gpigpi
    edited 2:10AM
    No
  • edited 2:10AM
    If your dbcross is based on any database try this idea:

    Let the table MyTable contains data like this

    State, Month, NB (Newborn babies)

    AL, 1, 1000
    AL, 2, 1300
    AL, 3, 999
    NY, 1, 300
    NY, 2, 340
    NY, 3, 350
    CA, 2, 300
    CA, 3, 340

    Here is a query that is used in dbcross.
    I mean - rows show states, columns show newborn babies in months, grand total shows all newborn babies in the state

    select T.State, T.month, T.nb,
    (select sum(nb) from MyTable T2 where T2.State = T.State) as MyTotal
    from MyTable T
    order by MyTotal

    Use this query to construct dbcross with State, Month and NB only. Do not use MyTotal

    The last thing to do is to set sorting of State in dbcross to None :-)

Leave a Comment