Jump to content
We've recently updated our Privacy Statement, available here. ×

Transformation on DB: Filter row. How to filter records with max value in a colum grouped by another column.


Veronica Nerozzi

Recommended Posts

I would like to apply a filter row to select only records with the max value on the field "ID1" for each value in the column "ID2".

I have tried to insert a filter row with the formula: max([iD1]) OVER ([iD2])

but it returns me an errore saying "incorrect expression type 'Real'". The expression must have type 'boolean'"

How can I do?

Thanks.

Link to comment
Share on other sites

You need to define it as:

[iD1] = max([iD1]) OVER ([iD2])

A filter is a Boolean expression that filters in values that are returned as True. In this case, all values of [iD1] that are equal to their maximum values over [iD2]. So the expression you defined is a 'mask' that is applied by testing every row to check it is True or False.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...