benmayo Posted January 25, 2013 Posted January 25, 2013 Dear FileMakers I have two data loggers, each outputting data to a CSV file, which then gets imported into two separate tables on my FM DB. One data logger creates a record each second, the other each minutes. So I can splice the seconds data together with the minutes data, I am trying to create a third table with time in minutes, which averages the data from the seconds table. So I'm trying to create a third table to average the output of the seconds table into minutes. Starting at the Average table, I need to get the value in the time field (say 12:20) and to then go to the Seconds table, and find all records between 12:20:00 and 12:20:59, take an average of the specific field and then paste that back into the relevant field within the Average table. That's how the code would run in my head - but I might be way off base. I hope someone can unpick this for me and help. Many thanks, Ben
comment Posted January 25, 2013 Posted January 25, 2013 I don't think you need a third table here. Define a calculation field cMinute in the Seconds table (result is Time) = Timefield - Seconds ( Timefield ) and use it to establish a relationship between the two tables matching cMinute to the timefield in in the other table. Then use a calculation field in the Minutes table = Average ( Seconds::Valuefield ) to average the values of the related records in the Seconds table. Note: Seconds() is a Filemaker function; although naming a table "Seconds" is valid, it could lead to confusion.
benmayo Posted January 25, 2013 Author Posted January 25, 2013 Thank you Comment, that is a very elegant solution and works perfectly.
Recommended Posts
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