Newbies aajish Posted October 2, 2006 Newbies Posted October 2, 2006 Hi, I have a field - gender. I need to count number of males and number of females in the portal!! when i do count function it only read the first one in the portal. I want to be able to say Select Gender = "Male" and Count. what do i doo??? please help!?!
John Mark Osborne Posted October 2, 2006 Posted October 2, 2006 (edited) Your best bet is a series of 4 calculations. The first two are created in the child table: Males = Case(Gender = "Male"; 1) Females = Case(Gender = "Female"; 1) The last two calculations are created in the parent table: MaleCount = Sum(CHILDTABLE::Males) FemaleCount = Sum(CHILDTABLE::Females) In the future, if you have more categories than just male and female, you are better off looking into subsummaries. Otherwise, you will need 2 calculations per category. Edited October 2, 2006 by Guest
comment Posted October 3, 2006 Posted October 3, 2006 If you don't expect more categories than just male and female, you can make the gender field a number field (0 or empty is female, 1 is male - or the other way around). Then you can count them as: MaleCount = Sum ( Child::Gender ) FemaleCount = Count ( Child::ParentID ) - Sum ( Child::Gender ) Note that this method implies a default gender when creating a new record.
Newbies aajish Posted October 3, 2006 Author Newbies Posted October 3, 2006 hi, thanks for ur help.. just one problem! when i try reading portal it only read whatever is in my first record. If it says "male" it counts rest of them as males and if first record is female it counts all the other records as females.
John Mark Osborne Posted October 3, 2006 Posted October 3, 2006 It's not clear what is happening? Did you follow the directions giving by me or comment? Which parts of the formula did programmed in? Any details would be helpful.
Newbies aajish Posted October 3, 2006 Author Newbies Posted October 3, 2006 sorry.. this is how my database is one file contains all the information about mice that we are working with. the information contains.. parents, date of birth, sex, colour, tag #. Now i am making another database that gets the information from this first database and puts in another database that organizes it according to the breeding pairs. I have a portal in the second database that gets the information from the first database based on the breeding pair (parents). The portal also gives information about the sex and date of birth of mice from that certain breeding pair. I need to summarize the number of females and males from each breeding pair. I used the formula given by "comment" and it works only if i have another field in the first data base. I wanted to be able to count the number of females and males using the portal and not have to make another field in the first database. i am not sure if that is clear. also i am not clear about using case function. Should i be using that in first database or second one where the portal is?
Newbies aajish Posted October 3, 2006 Author Newbies Posted October 3, 2006 Here is the picture of the portal that i need to do calculation for. I was able to do what comment said.. now i have another issue.. i need to summarize the genotype!! ie. have a small table saying that this breeding pair has 4 pups with "+/- cre/+ lox/+" and 1 "-/- cre/+ +/+". lemme know if this is confusing.. please i really need to get this done soon : any help wud be appreciated thanks a million
Newbies aajish Posted October 4, 2006 Author Newbies Posted October 4, 2006 Sorry, here is another try! If you look at the picture i have attached you can see that the portal has fields called Fgl2 Cre LoxP I need to be able to summarize how many of those records have Fgl2 = +/- , Cre = Cre/+, LoxP = lox/+ So basically I want to write formula that would be something like {Count(IF Fgl2 = "+/-" & Cre ="cre/+" & LoxP ="lox/+")} just one another question, is it possible to merge fields in portal?
Recommended Posts
This topic is 6962 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