Dynamic sort on an Aggregation

Dynamic sort on an Aggregation

  
I have a screen with a table records with a number of 'normal' fields and one Aggregation (max(DueDate)). I would like to add this Aggregation to the dynamic sort, but i don't see how. I first tried to select the AccountTable.List.Current.DueDateMax in the 'Column' property of the List_SortColumn RichWidget, but although the e-space is valid, when using i get an error message: Invalid syntax in 'OrderBy' parameter. Next i tried to use the original, not Aggregated, entity attribute {Action}.[DueDate], but that doesn't work either.

Does anyone have an idea?
hi,
Can u plz attach the sample oml file.

Thanks,
MJ
I think the question is clear enough without a sample OML, but I don't know a solution of the top of my head. Basically, calculated columns need a HAVING in SQL, and I'm not sure whether this is supported by Aggregates. Probably not, come to think of it... Maybe someone from OutSystems can weigh in.
Solution
Put a name on the calculated attribute and use this name on the List_Sort_Column. If you try to refer it as table or something like that you will have an error.
Solution
Yes, that did the trick, see screenshot below. Thanks Luciano!

 
Cool, didn't know it worked like that. +1!
You are welcome Leen