Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

Sorting the groups – PB Docs 125 – PowerBuilder Library

Sorting the groups – PB Docs 125

Sorting the groups

You can sort the groups in a DataWindow object. For example, in a DataWindow object showing
employee information grouped by department, you might want to sort
the departments (the groups) by total salary.

Typically, this involves aggregate functions, as described
in “Adding summary statistics”.
In the department salary example, you would sort the groups using
the aggregate function Sum to calculate total
salary in each department.

proc.png To sort the groups:

  1. Place the mouse pointer on the group header
    bar (not inside the band) until the pointer becomes a double-headed
    arrow.

  2. Click.

    The General property page for the group displays in the Properties
    view.

  3. Click the ellipsis button next to the Group Sort
    property.

    filt21a.gif

    The Specify Sort Columns dialog box displays.

  4. Drag the column you want to sort the groups by
    from the Source Data box into the Columns box.

    If you chose a numeric column, PowerBuilder uses the Sum function
    in the expression; if you chose a non-numeric column, PowerBuilder uses
    the Count function.

    For example, if you chose the Salary column, PowerBuilder specifies
    that the groups will be sorted by the expression sum(salary
    for group 1)
    :

    filt22.gif
  5. Select ascending or descending sort as appropriate.

  6. If you want to modify the expression to sort on,
    double-click the column in the Columns box.

    The Modify Expression dialog box displays.

  7. Specify the expression to sort on.

    For example, to sort the department group (the first group
    level) on average salary, specify avg(salary for
    group 1
    ).

  8. Click OK.

    You return to the Specify Sort Columns dialog box with the
    expression displayed.

  9. Click OK again.

    At runtime, the groups will be sorted on the expression you
    specified.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x