bonngo Posted January 17, 2008 Posted January 17, 2008 I need to be able to take a found set of records that have a date field and a number field. From this, I need to create from the number field a "three-week" average field of the number field. The calculation I would have to take the current date and go back three weeks to average out the number. Anyone have any ideas?
Søren Dyhr Posted January 17, 2008 Posted January 17, 2008 Will there be omissions in the dates, or oppsite be several records on one day? But provided that each day is a new record could the aggregate function be made to Avarage( over a 21 cell repeating calc'field containing this: Substitute(GetNthRecord ( Extend ( theNumber ) ; 1+Get ( RecordNumber ) -Get ( CalculationRepetitionNumber ));"?";"") --sd
bonngo Posted January 17, 2008 Author Posted January 17, 2008 Yes to both - there could be omissions in the date and multiple records for one day.
comment Posted January 17, 2008 Posted January 17, 2008 I need to be able to take a found set of records Why don't you constrain this found set to the last three weeks, and use a summary field for the average?
Søren Dyhr Posted January 17, 2008 Posted January 17, 2008 Is it for a stock exchange observations system, where a gliding average is used for sale/purchase decisions? BTW I played a little with my suggestion, it's important that the repeating calc' is unstored, otherwise won't it adjust to the found set - a refresh issue. --sd
bonngo Posted January 22, 2008 Author Posted January 22, 2008 Yes, the concept is very much the same. User needs to look at a record showing a current number and also an average of that number for the last weeks.
T-Square Posted January 23, 2008 Posted January 23, 2008 Perhaps a self-join with a three-week criterion, and an average calculation on the related records?
Søren Dyhr Posted January 23, 2008 Posted January 23, 2008 The only problem is that aggregate functions probably are to weak a measure to such a problem, the burden of records could dictate something in this direction: http://www.fmforums.com/forum/showpost.php?post/278725/ --sd
bonngo Posted January 29, 2008 Author Posted January 29, 2008 Thank you all very much for your assistance...I did find a self-join relationship worked.
Recommended Posts
This topic is 6203 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