Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Counting Value List items?


This topic is 6876 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Can someone tell me how to count the items in a value list? For example, I want to be able to count the number of males and females in a group (Male and Female are in a value list). This would also apply to other fields (for example, Major (Chemistry, English, Education, Music, Art), etc.

Thanks!

George

Posted (edited)

Michael,

Thanks so much for your help. I'm sorry I didn't explain my needs as well as I should. Re-reading my post, I see that it is confusing.

Basically, I want to have an administrative page -- one that tells me various data on the students. For example, I want to count all of the males and females in the class (I have a GENDER field with MALE and FEMALE radio buttons). I want to have keep a running tally of the number of the gender of these students (I have to report this at times). So, I want a page that says I have (for example) 25 males and 150 females (I assume I would have separate fields to count each value list entry?)

Once I can do this, I can also use the same formula to tally other value lists (or example: MAJOR has various majors in the list (Business, Arts, Music, etc., etc.) -- ultimately telling me I have 5 Business Majors, 10 Arts Majors, 75 Music Majors, etc.)

Thanks for your solution, too. Very neat!

George

Edited by Guest
Posted

I'm afraid I still don't see the difference. The built-in Filemaker solution for this is to produce a subsummarized report. If you want a "live" count via a relationship, you will need a relationship and two fields, one on each side of the relationship, for EACH SUMMARIZED ITEM. My demo uses one repeating field for EACH VALUE LIST, and you can place the summary field repetitions on the parent's layout.

If I am still missing it, please attach a demo showing your file's structure.

Posted (edited)

Hi gbrozak,

It would be nice to be able to follow/see your problem. Because I have similar problems and I guess I'm not the only one, am I? So it would be great if you could share your file. Since my english is not so good, an example file is always good to look at :

Edited by Guest
Posted

Your file has only one table - I presume this is meant to be a table of Students? It would be quite easy to get the stats on gender, since gender is an attribute of Student, and would be noted in the student's record, in the same table.

I am not sure we can say the same thing about counting how many students are in Accounting, for example. Is Accounting an attribute of Student? If a student is in Accounting, does this mean he/she cannot be in Basket Weaving (as your radio button would indicate)?

Posted

OK, I have scrolled to the top and saw these are majors, so I guess the answer is yes.

Here's the same file I referred to earlier, with no modifications except changing the value list and a few field names. That deals with the majors. I have also added a simple mechanism for gender.

sumByCategorySimple.fp7.zip

Posted

Michael,

Thanks for your solution. I appreciate the time it took to put that together. A few questions:

1) Can the male/female field (GENDER) be a radio button or check box instead of entering a 0 or 1? I ask this because different people will be entering data, and the easier I can make this (ie, check boxes/radio buttons) the better.

2) You have the calculations being done in a footer on the main entry page. I would like this to be done on another page (an ADMINISTRATION layout). Can this be accomplished anywhere in the file? Also, as you can see in my sample file, each "page" would be one student (this is a LOT of data on one student) and not a columnar report format. That's why I'm asking about an "ADMINISTRATION" page somewhere else in the file.

3) Would it be easier if the MAJOR field, for example, were not a value list, but a simple text box? My assumption is it would not be (since text can change so easily) but wanted to ask.

Thanks again!

George

Posted

edit: Per Comments suggestion I'm letting him take it one thing at a time. I could not bring myself to erase the part about the Radio Set though *shrugs*

If a student is in Accounting, does this mean he/she cannot be in Basket Weaving (as your radio button would indicate)?

I'm sure you are aware that in Filemakers World a user can select more than one value from a Radio Button Set. As far as I know more than one value can be entered no matter how the field has been formatted. You can validate by ValueCount(MyField = 1) but as usual this doesn't stop the problem before it occurs. I wonder if an AutoEnter Calc set to replace existing value would work....

edit: Ok the last part was a lot easier than I thought, though I am still a little dismayed a user can select more than one value by default (especially from a Radio Set).

The following auto-enter calc did the trick:

RightValues (MyField ; 1 )

Posted

1) Can the male/female field (GENDER) be a radio button or check box instead of entering a 0 or 1? I ask this because different people will be entering data, and the easier I can make this (ie, check boxes/radio buttons) the better.

In my file, there's a form layout layout where you can toggle the gender by clicking on it. You can make your file however you like - this is just one example. But getting stats on text fields is much harder - just compare the gender and the major.

2) You have the calculations being done in a footer on the main entry page. I would like this to be done on another page

Make another layout based on the same table, copy/paste the fields to there.

Can this be accomplished anywhere in the file?

No - only on a layout that belongs to the Students table.

each "page" would be one student.

See 1) above.

3) Would it be easier if the MAJOR field, for example, were not a value list, but a simple text box?

No - it would be practically impossible - at least as far as this technique is concerned. You would have to ... well, it's so much work I'm not going into it.

Posted

Hi

Thank to the ZIP file from Comment, I got an Idea how to count things together from a Value List. I'm actually just looking for something like that :

I do have a question:

Is it possible to count different Values for each group together? Something like this:

Lets say I've got a ValueList:

A

B

C

D

Entered Numbers in A (Numbers means a Currency): 12.00, 10.00

Entered Numbers in B: 100.00, 5.00

So is it possible to get a List out, which counts the value together from each ValueList?

=> A = 22.00

=> B = 105.00

=> C = 0.00

=> D = 0.00

I didn't find a solution to SUM those values up or I do miss something here. I tried to modify the "sumByCategorySimple.fp7.zip", but doing something wrong.

Thanks for any help :)

This topic is 6876 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.