The issue is how would the two records relate to each other.
If there was a field called parent jobid then you could use a self relationship and if stament in the calculation to establish the calculation. However since this calculation will now be a related calc that adds some issues.
the calc would be something like if(Thistableoccurance::Parentjobid ="", (calc based on this record),(calc based on related record))
You would need a second table occurance and a relationship between ParentID and JobID.
That is exactly what I want. And the Main Job is that parent jobid that you are talking about. It is the related calculation issues that I'm having trouble overcoming.
Thanks for weighing in.
You would need something in your child jobs that allows you to link the record back to the main job.
In this case we would need a field called Parent Job
Then in the manage database relationships tab we would add a second table occurance of this table. name it Parent Jobs
Then we would link the field called Parent Job in the layouts table occurance to the Invoice Number in the Parent Jobs table occurance.
for each child job you would need to update the Parent Job field with the matching value of Invoice Number to the Parent Job.
Then you just need to change the Cover Run calculation to add the if condition of the Parent Job field being blank to calculate values from this record or calculate as a Percent of Related values calculation. Not sure if this might cause some reference problems in the calculation because I havent tried it yet. If it does you may have to do some work around where the calculation isnt as dynamic and the value is actually written to a field in a script. (if using FM11 you could assign the script to various script triggers to ensure it stays current)
Thanks. This is the relationship that someone else explained in a previous post where I didn't do a good job of explaining the situation (the .jpg helped this time). Your further explanation of the calculation helps. It is the "calculate as a percent of related values" part I'm not sure of, or more specifically, the related values part. I'm not sure how to write that into the calculation. It sounds like you are not 100% sure if this will work or not either. If you happen to test it and find a way to make it work, please let me know. Otherwise I appreciate any other input from other posters. Thanks!
Lets say your table occurances are Main and Parent and your calc value is total
Then your calc would be like this If(Main::Parent_Job = "", Qty * Price, Parent:Total *.8)
It apparently works because I set it up exactly like that.
Here is a demo
It worked!!! I may need help with some complicated calculations in the future, but this did the job for now. Thanks!