Calculation field subgroup countHello,
This is probably a newbie question, but I can't seem to find the answer. I am looking for a way to program a calculation field that would give me for each individual the total numbers of the subgroup to which he belongs. The subgroup is determined by 3 variables: Year of birth - Gender - Employment.
Example:
Row #1: 1930 - Woman - Nurse [17]
#2: 1930 - Woman - teacher [74]
#3: 1930 - Man - Plumber [49]
#4: 1930 - Woman - Nurse [17]
#5: 1930 - Man - Plumber [81]
#6: 1930 - Man - Lawyer [15]
#8: 1930 - Woman - teacher [74]
…
#333: 1931 - Woman - Nurse [63]
#334 1931 - Woman - teacher [134]
#335 : 1931 - Man - Plumber [128]
#336: 1931 - Woman - Nurse [63]
etc
I could of course get this information by doing a crosstab, but I need to have it in a column for each of the individuals in my population in order to calculate indicators.
Thanks a lot for your help..
Data TablemacOSRe: Calculation field subgroup countHi @claude_bellavan ,
I'm not sure how your data table is organized (as this would probably affect how you accomplish what you're after). It seems to me that each entry (row) should have at least three columns: BY, Gender, Occupation -- I'm not following what the [17] and so on represent, but anyway, if you have your data table organized like the Car Physical Data.jmp file, you can create a column formula that does what I think you're trying to do. Take a look at the screenshot below where I've defined a column formula as Col Number(XCol, ), where the function returns the number of non-zero entries in the column XCol, but sorted by the byVar column. In this example, since both "Small" and "Compact" vehicle type have 22 entries, they're lumped together in the Column 9 output.

Hope this help!,
DS
Re: Calculation field subgroup countI am confused as to what you want the output to look like. For the data you supplied, what would the output look like?