chinita Posted October 5, 2010 Posted October 5, 2010 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.
Chris Cain Posted October 5, 2010 Posted October 5, 2010 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
chinita Posted October 5, 2010 Author Posted October 5, 2010 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?
Chris Cain Posted October 6, 2010 Posted October 6, 2010 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.
comment Posted October 6, 2010 Posted October 6, 2010 I believe I would do it this way: SummaryReport.zip
chinita Posted October 8, 2010 Author Posted October 8, 2010 This is excellent! Thank you so much, Chris and Comment! This forum is so useful. =)
Recommended Posts
This topic is 5164 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