I've hunted until I'm tired.
I'm trying to get a calculated field total for a specific group of filtered records on a Form. I haven't mastered the calculated field concept of groupings, clearly, and unable to get my mind around how to construct this, if it is even possible. If expression? Case expression? Another added grp-> in the current calculated field?
I have a 'Sales" table that holds the sales of stocks. There is a field 'Sale_gain' that holds the value for the gain that I am wishing totalled. The sales_gain is a hard number, numeric type field and not a calculated field. The calculation is made in the function that writes to the Sales table. I have a field named 'sale_type' that has values of 'short term', 'long term' and 'tax-exempt'. I would like to make three calculated fields, one for each of the sales type, that totals the sale_gain value for each sales_type in the current records in focus. I filter the records based on year and/or account and have those records show in an embedded browse. I have a calculated field which totals the sale_gain for all the filtered records in focus. That calculated field is this:
What I would like is to also have calculated fields which shows me the totals for each of the sub groups of short term, long term and tax-exempt. How do I subgroup on those records within the currently filtered records?
I'm sure I can generate the value into a session variable using tablesum within the UDF that I have filtering the table, but I would rather the values exist "ambiently" through a calculated field.
I'm trying to get a calculated field total for a specific group of filtered records on a Form. I haven't mastered the calculated field concept of groupings, clearly, and unable to get my mind around how to construct this, if it is even possible. If expression? Case expression? Another added grp-> in the current calculated field?
I have a 'Sales" table that holds the sales of stocks. There is a field 'Sale_gain' that holds the value for the gain that I am wishing totalled. The sales_gain is a hard number, numeric type field and not a calculated field. The calculation is made in the function that writes to the Sales table. I have a field named 'sale_type' that has values of 'short term', 'long term' and 'tax-exempt'. I would like to make three calculated fields, one for each of the sales type, that totals the sale_gain value for each sales_type in the current records in focus. I filter the records based on year and/or account and have those records show in an embedded browse. I have a calculated field which totals the sale_gain for all the filtered records in focus. That calculated field is this:
Code:
cfSum_Gains = total(Sale_Gain,grp->Grand)
I'm sure I can generate the value into a session variable using tablesum within the UDF that I have filtering the table, but I would rather the values exist "ambiently" through a calculated field.
Comment