The Professor Posted September 17, 2003 Posted September 17, 2003 Hi All, First time poster in desperate need of help. I have a simple DB tracking actors at a talent agency. Each actor is assigned a Division via a value list: infants, kids, young adults, seniors. Each actor also has an Agent Status of a simple yes, no. How do I get a running percentage of each Division's Agent Status? 50 kids total, 20 have agents = 40%. I've gotten it to work, but only via a trailing grand summary on a dedicated layout for each Division. How do I get the percentage fields for each division to display correctly and update automatically and globally at the top of my main layout? I know this is a lot to ask from a new member but any help would be greatly appreciated.
BobWeaver Posted September 17, 2003 Posted September 17, 2003 You need to set up some self-join relationships, one for each Division. Create 4 calculated fields whose formulae are simply the constant values: cConstInfants = "Infants" cConstKids = "Kids" cConstYoungAdults = "Young Adults" cConstSeniors = "Seniors" Then create 4 relationships: sjInfants: cConstInfants matches Division sjKids: cConstKids matches Division sjYoungAdults: cConstYoungAdults matches Division sjSeniors: cConstSeniors matches Division Now create 4 unstored calculations: cAvrgInfants = Sum(sjInfants ::Agent Status)/Count(sjInfants ::Division)*100 cAvrgKids = Sum(sjKids::Agent Status)/Count(sjKids::Division)*100 cAvrgYoundAdults = Sum(sjYoungAdults::Agent Status)/Count(sjYoungAdults::Division)*100 cAvrgSeniors = Sum(sjSeniors::Agent Status)/Count(sjSeniors::Division)*100 These calculated fields will give you your percentages.
Ugo DI LUCA Posted September 17, 2003 Posted September 17, 2003 Hi Bob, Hmm.. cAvrgInfants = Average(sjInfants ::Agent Status)*100 cAvrgKids = Average(sjKids::Agent Status)*100 cAvrgYoundAdults = Average(sjYoungAdults::Agent Status)*100 cAvrgSeniors = Average(sjSeniors::Agent Status)*100 with AgentStatus = is notEmpty(AgentField) Wouldn't that work too...
BobWeaver Posted September 17, 2003 Posted September 17, 2003 Yeah, I forgot about the Average() function.
The Professor Posted September 17, 2003 Author Posted September 17, 2003 Hi Bob and Ugo, Thanks so much for your input! I'm trying these out now and hopefully I wont screw it up. Am I correct in assuming that no grand summary part is required for this to work as you describe?
The Professor Posted September 18, 2003 Author Posted September 18, 2003 Stymied already! When I try to create the first calculation field and use ConstYoungAdults = "Young Adults" I get a "This Field Cannot Be Found" error. Do I need to "point" this calculation at my Division field? Thanks again in advance.
Ugo DI LUCA Posted September 18, 2003 Posted September 18, 2003 The Professor said: Stymied already! When I try to create the first calculation field and use ConstYoungAdults = "Young Adults" I get a "This Field Cannot Be Found" error. Do I need to "point" this calculation at my Division field? Thanks again in advance. ConstYoungAdults is a field_name "Young Adults" should be entered in the box qith quotes, and obviously must match one of your Division Name. As for your previous question, no you don't need a Grand Summary for this to work. It's based on relationship while Summaries are based on the founds...
The Professor Posted September 18, 2003 Author Posted September 18, 2003 Worked like a charm! Bob and Ugo, thank you so much for taking the time for a newbie.
Recommended Posts
This topic is 8078 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