Hi,
being this topic already solved, I would like to leave just a note for discussion. I was implementing the same thing and checked forums to check if people though of different solution from mine.
Because you can't group by a literal, to achive that, you need to name the literal, wrap it in another Select and group by that column name, which aggregates doesn't do, so they have the condition that you can't group by that literal.
To achive the goal of having an attribute in the aggregate which is always the same on Preparation and can still use the aggregate in the screen (because it's simpler and cleaner) what I usually do is:
- Create a new attribute on the aggregate
- Assign something like Entity.Id <> Entity.ID (the point here is to make an assertion which is always false) and name it IsSelected
- Group by the values I need + this attribute IsSelected
Regards,
João Franco