SmartClient Version: v9.0p_2013-11-14/PowerEdition Deployment (built 2013-11-14)
I have a datasource with two fields, "cost" and "retail", and I need to calculate a "margin" using those two fields as 1-(cost/retail).
Originally I defined a user formula which works perfectly, except for filtering. The users want to apply a filter to select records where margin is > x. So instead of a user formula I created a customSelectExpression to calculate the value. This provides the filtering they were looking for.
But the datasource is attached to a ListGrid that shows grid and group summaries. The problem is that the margin column is being summed for grid and group summaries when instead it needs to be recalculated using the sum of cost and retail for the grid or group.
How can I combine the two techniques so the detail row values are calculated by the SQL query (to allow for filtering), but the summaries are calculated by the user formula?
I have a datasource with two fields, "cost" and "retail", and I need to calculate a "margin" using those two fields as 1-(cost/retail).
Originally I defined a user formula which works perfectly, except for filtering. The users want to apply a filter to select records where margin is > x. So instead of a user formula I created a customSelectExpression to calculate the value. This provides the filtering they were looking for.
But the datasource is attached to a ListGrid that shows grid and group summaries. The problem is that the margin column is being summed for grid and group summaries when instead it needs to be recalculated using the sum of cost and retail for the grid or group.
How can I combine the two techniques so the detail row values are calculated by the SQL query (to allow for filtering), but the summaries are calculated by the user formula?
Comment