corey Posted August 7, 2003 Posted August 7, 2003 I have 5 fields per record = unique code relating to [category] [category]= Text field with Value List attached (19 options) [cost]= Number field [price]= Number field [margin]= Calc field to display margin (%) between [cost] & [price] I want to create a CALCULATION field to add the [cost] results together, BUT only according to what [code] was selected. EG. if [code]=1 then [category]="labour" Then i want the CALC field to add the [cost] value from ONLY the record that [category]="labour". I can't seem to get an 'IF' CALC to work. Is a 'CHOOSE' or 'CASE' the way to go ? The total needs to ADD ALL records that have the same Category selection. Any help appreciated. Coza....
djgogi Posted August 7, 2003 Posted August 7, 2003 Simply define self relationship on code and then create a calculation field: CategoryTotal=Sum(SelfRel::cost) Dj
-Queue- Posted August 7, 2003 Posted August 7, 2003 It sounds like Sum( code::cost ) is all you need, where 'code' is a self-relationship from the code field to itself. If the category for the record is 'labour', code = 1, for example, then this will give you the sum for all records in the file with the same category/code.
corey Posted August 7, 2003 Author Posted August 7, 2003 I still cant seem to get totals with the above mentioned. Attached is a example of what i have, Any help Please. Corey....
corey Posted August 7, 2003 Author Posted August 7, 2003 OOPs can't attach it. I can email it to any one who can help. [email protected] Thnx Corey....
Recommended Posts
This topic is 7849 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