October 5, 201015 yr Hi all. I think I have a simple scripting issue. I have a table with three pieces of information: places, dates, and names (each record is one kid's name, the place he attended the workshop, and the date he attended). The idea is, we've been holding workshops at certain places on certain dates and we want to calculate the number of people who attend these workshops. I'm sorry I'm a real newbie with scripting. I'm currently working on trying to calculate the total number of children who attended workshops on a certain date in a certain place. I'm trying to set up a script that loops - after sorting the records, it goes through all the records and if the place and date are the same, it adds one to the counter. Once the date and place are not the same, it outputs the number to a field. Is there a more efficient way to calculate this? I feel like there should be an easier way. Thanks in advance for anyone's input.
October 5, 201015 yr Create a self-relationship by date and location. With that, you can calculate the count of the related records. You can also use a go-to-related script step to view all records for that date and location, if you want to take the user there. HTH
October 5, 201015 yr Author Wow, Chris. Thank you so much for your quick reply! I understand what you mean about creating a self-join relationship and have done so, but since there are different "date and location" pairs and thus different counts, I'm not sure how to go about exactly "counting related records." Would I use a script?
October 6, 201015 yr OK, create a relationship between Table and Table_self where date = date and workshop = workshop. In your table, create a calculated field that equals Count ( Table_self::primary_key ) I don't think you'll need a script for anything, here.
October 8, 201015 yr Author This is excellent! Thank you so much, Chris and Comment! This forum is so useful. =)
Create an account or sign in to comment