Calculate value in the list
How can I sum value of each item in the list into single number . As in screenshot I use Sum(Field name) but result was just number of item followed by another.
Number 2 gives you an immediate fix that you can apply to your existing solution. Sometimes you need that so that you can move forward while you figure out the more involved change such as that required for number 1.
Define an unstored calculation field and paste the above expression into the specify calculation dialog box. Change "yourfield" to a reference to the field you have formatted with that check box. Put it on your layout and you'll see the total computed. The functions that I used can be looked up in FIleMaker help and you can play with them in separate fields to see what each function does with the original data in your check box field.
To use a set of related records, I'm going to use a simplified approach that does not reproduce the check box format. If you can get it working, we can look at how to convert it into what looks like a single field with check boxes but which actually is a portal with multiple rows of records. (this part requires scripting and conditional formatting.)
Let's call your current table MedicalHistory. If it does not have a field that auto-enters a serial number or Get ( UUID ) add one that auto-enters a serial number. I'll call that field __pkMedHistID. Use Manage | Database | Tables to create two more tables: CardiacDetails and CardiacDetailValues.
Define these fields for CardiacDetails:
_fkMedHistID (number field, no auto-enter options)
Define These fields for CardiacDetailValues:
Open up the layout for CardiacDetailValues and enter the data you show in your screen shot. Enter "Myocardial Infarction" in the Description field and 1 into the value field. Repeat for each cardiac event listed in your example shown above.
Open up Manage | Value Lists and Select the "use values from a field" option to set up a list of all values from Description in the CardiacDetailValues table.
Open Manage | Database | Relationships and drag from field to field in the Table Occurrence boxes to create the following relationships:
MedicalHistory::__pkMedHistID = CardiacDetails::_fkMedHistID
CardiacDetails::Description = CardiacDetailValues::Description
Double click the line between CardiacDetails and MedicalHistory to open the Edit Relationships dialog. Click the "allow creation of records via this relationship" check box on teh CardiacDetails side of the relationship.
Use the portal tool to add a portal to cardiacDetails on the Medical History layout. Include the Description field from CardiacDetails and the Values field from CardiacDetailValues in this portal.
Define this calcualtion field in Medical History and put it on your Medical History layout to show the total: Sum ( CardiacDetailValues::Values )
Are you saying that all these checkbox items are part of the same field? What is your table/field setup? Relationships?
Yes, I put all items in one field. If there is any way better you can suggest me because I am very new with this.
Using a portal to a related table where each value is selected in a different related record would make it much easier to compute a count, total or other aggregate value. It can also make a number of different reports based on this data easier to create
Evaluate ( Substitute ( Filter ( YourField ; "9876543210¶" ) ; ¶ ; " + " )
Will, however, compute the total that you requested.
Thank you for your comment butI I am just a newbie. I read it from" Filer Maker Pro12: The Missing Manual" but I don't know which part I should look for that topic. Or you can suggest me where I can study more in detail ?
I suggested two things: 1) a design change for your underlying tables and relationships and 2) an expression that will use the data I see in your screen shot and compute a total.
With which do you want additional help? 1 or 2?
No. 1 choice first. But I also curios the second choice too
Thank you so much for your help. I prefer 1st choice, it's a lot easier than the other and fit my need. But If I have more time I will study 2nd choice later.
Retrieving data ...