Jump to content

lord_lordy

Members
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

0 Neutral

About lord_lordy

  • Rank
    novice
  1. It was really just highlighting that I wanted the logic separated in to a subscript so it wasn't repeated in 50 different places. Just easier to maintain. I've managed to get it to work by passing in the name of the field to do the calculation on.
  2. (hopefully) final problem. How do I sort on the appropriate field when I'm using a subscript which has the field passed as a parameter ? My best solution is to have a separate field in the table for sorting and the subscript will copy the contents of the named field into that and then sort on the sort field. Is there a better way of doing this copy other than looping through the whole table and copying each individually ?
  3. IGNORE last post Almost immediately on posting that I found what I was looking for. No idea why I hadn't seen it before.
  4. The sorting method works great. I want to move it to a subscript which gets called with the field to be used as I have to do this calculation on 50+ fields. How to I get the value of a field using the name of the field. There's a set field by name but doesn't appear to be the equivalent get field value by name. Am I missing something?
  5. thanks for that. I think the penny may have just dropped ... never thought about sorting them. As an aside I am finding moving this to a database enthralling largely because I can see a steady change in the way I think about problems and there's several occassions where I suddenly realise I should use a relationship and the problem becomes easy ! thanks for all your help.
  6. I think I've worked out a better way to do this - set up a relationship using a ">" so that I can just count all the related records. This works fine when the field I'm using is a number but doesn't work when it's a field calculated from related fields. Am I right in thinking that such relationships can't be constructed ?
  7. Thats right. In this context it's what makes this metric interesting. So this was length of bike rides it would mean 20 rides of at least 20 miles. 1 more ride of 21 in this case would take it to 21, 5 of 25 would take it to 25 but to get to 26 would require 26 rides of 26 miles or more. ie the number gets progressively harder to improve.
  8. I am not iterating to find the result. Instead the user can type in a suggested value and a trigger runs the script which calculates the count for that value and the next. Once the result is found then there's only need to monitor the next value to see when the value has gone up. Didn't post the script as wasn't expecting anyone to debug for me ! Thought there may be some typical things that may cause it. Attached is the script. Can attach the whole DB if someone really wants to help that much. EdNum_Script.pdf
  9. In my training diary I am calculating Eddington Numbers. For a given numeric field this is the maximum number X such that there X or more occurrences with a value of at least X. I've got this working for Life To Date figures - this means you look at the full set of values. This has been done by having a script that counts the occurences greater than a given value X and also counts for value X+1. It uses fields in the Top level table (for which there is only one row) to maintain the counts. Now I am trying to do this to calculate the numbers for each year. This means it looks for tha
  10. Clone of my DB attached. Thanks for your help TrainingDiary_Clone.fp7.zip
  11. Hi, I have a training diary with entries every day for the last 7 years. I want to track several week to date figures across numerous fields. Some as simple as week to date total other more complicated calculations. I've managed to get this to work by creating a self join so I can get at the previous 6 days. This works but makes many of my layouts very slow. I'm assuming it's because all the results are not stored. Since once a day is passed these values don't change they may as well be stored as a number. I'd like to move this over to a script and thought I could by using "Insert C
  12. Sorry if I've confused this. There is data every day. It's just there won't be a workout every day. The value for "CTL" will be there everyday as this is effectively load from previous days decayed based on time plus a factor based on todays load (which may be zero). The process here would be a user would input daily data. Now they won't necessarily do this everyday but they will input an entry per day. For instance if they're away they may record data manually in a notepad and then when returning home input each days data at a later date. There is the issue that they may not enter d
  13. I think there is a better way and believe that some sort of trigger to run the script to populate the values when data is entered is the right solution. It can't be done in the child tables as they don't have an entry everyday. They include workouts that are done. The daily record includes a total load for the day which could be zero when there were no workouts and thus no entries in the child tables. The actual calculation is: Todays CTL = (Todays Load)*(1-Exp(-1/42)) + (Yesterdays CTL)*Exp(-1/42) Day to day this calculation could be done based on some sort of trigger (having
  14. It seems I can do that join using a field "Yesterday" which is a simple calculation of Date - 1 Am I missing something ? It appears I don't need to create a serial number for the date. It has lead to another problem which is that for the very first day there is no yesterday ! So for that first day the calculation is slightly different - ie the term that refers to yesterday is just zero. I think this is what's causing my current error. On a similar note I want to also have rolling weekly averages. I could do this by doing 6 self joins to the previous 6 days. This feels a little conv
  15. Thanks - I will give this a try. Not done a self join relationship so that'll be fun ! The daily load is based on a child table. Since once a day is gone the calculations won't change I had wondered about storing the calculated field - I'm making the assumption this will mean it won't recalculate it each time.
×
×
  • Create New...

Important Information

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