PowerBuilder Filter

How do I set the filter in the dw that has 2 groups.
1st group by AircraftID
2 group by Item_id and the details sections lists all the parts per Item with Remaininig hours.
How do I filter to display only the smallest value per part.
Thanks in advance.
Who is Participating?
batchakamalConnect With a Mentor Commented:
First put your sql as follows,

Select AircraftID, ItemId, Min(RemainingHours)
From YourTable
Group By AircraftID, ItemId

Then create only one group in the datawindow design by AircraftID.
and Place the AircraftID in the header of the group band.

Place the ItemId and Min(RemainingHours) in the detail band.

I hope this can solve ur problem.
michaelstoffelConnect With a Mentor Commented:
If you would like to use DW functionality instead of the SQL suggested, aggregate function in DW expressions can use "for group x" for example Min(RemainingHours for group 2)
mustafakocaConnect With a Mentor Commented:
you can use setfilter to filter your dw.

ls_filter = "kod2>"+sle_2.text+"and kod2<"+sle_3.text+"and kod='"+ddlb_1.text+"'"
dw_1.Filter( )

if you want to disable filter you can use below

dw_1.Filter( )
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.