Display only distinct rowsTag(s): Datawindow
First you need to Sort() the datawindow based on the columns that need to be distinct. After you apply a Filter(), to filter out the non-distinct rows.
For example, we have a datawindow with a column named prod_id and we want to display only one row for each prod_id.
First we turn off the datawindow redraw function to speed up the operation
dw_1.setredraw(false)
dw_1.setsort("prod_id a") dw_1.sort()
dw_1.SetFilter("IsNull(prod_id[-1]) OR prod_id[-1] <> prod_id") dw_1.filter()
dw_1.setredraw(true)