Newbies GroovyNewton Posted February 12, 2006 Newbies Posted February 12, 2006 I have a database in a single table with records that amongst other things contain a number field and a text field which are displayed on a layout. I have set up a second layout with a subsummary part containing a summary field for the total of number field values when sorted by the text field. The second layout also has a trailing grand summary part with the same summary field totalling the number field values. The second layout displays in preview mode. The second layout does not display the actual records. The result is that I get what I intended i.e. a series of subsummaries for each number value sorted by the text value and a grand total of these at the end. What I now want to do is to have a field for each subsummary that expresses the subsummary value as a percentage of the grand total value. However I have been unable to work out how to do this. Any suggestions would be much appreciated.
RalphL Posted February 12, 2006 Posted February 12, 2006 You need to use the getsummary function. Once for the sub-summary value and once for grand total. You can then use these in a calculation to get the fraction. Display the result as a percentage.
comment Posted February 12, 2006 Posted February 12, 2006 I don't think a calculation is required here. Define another summary field as Fraction of Total of your number field. Then place this field on the subsummary part (and on trailing grand summary - if you want to see 100%).
Newbies GroovyNewton Posted February 12, 2006 Author Newbies Posted February 12, 2006 Thank you very much. The Fraction of Total solution seemed the simplest solution and works well. Along the way I had another problem in that my original sort field was in a related file. The sort only worked for the purposes of the summary function after I put in a calculation field to give a text field in the primary file for the sort to work on.
comment Posted February 12, 2006 Posted February 12, 2006 I don't see why sorting by a related field should be a problem (other than being a bit slow). You need to make sure, though, that the sort field matches the group field in the subsummary part definition (Sub-Summary when sorted by ... )
Recommended Posts
This topic is 6923 days old. Please don't post here. Open a new topic instead.
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 accountSign in
Already have an account? Sign in here.
Sign In Now