Jump to content
Salesforce and other SMB Solutions are coming soon. ×

cumulative calculation


Christian Coppe

Recommended Posts

Maybe I'm tired, but I cannot find a solution : I have a database, let's say DB1, with records. For each record, the creation date is automatically introduced, and the year+month of creation calculated. I another database, DB2, I create some record, 1 for each month of each year. A link year+month links the two DB togheter.

It's easy to calculate the number of records for each month from DB1 in DB2, by NUMBER(dataDB1), for instance. Let's call this field numberDB1. Now, I would like to calculate a cumulative field (call cum), wich should show, for each month, the total of record in DB1 up to the concerned month. Example : suppose that I have 10 records in DB1 for each month. In DB2, the field numberDB1 in each record will show the number 10. I would like that my cumulative field, cum, shows 10 for the first record, 20 for the 2d, 30 for the 3rth, etc...

I have tried by creating a counter, a link with the previous record (counter-1), and saying : "if the counter=1, take numberDB1, else take previous record::cum+numberDB1". It doesn't work, FMP saying that I create a circular reference... Any idea ? I would like to not run a script.

confused.gif

Link to comment
Share on other sites

Sorry Andy, I was certainly confused. I have put "10" at each month in my example only to simplify, but this number vary strongly from one month to another... Then, suppose that numberDB1=10 for the 1st month, 16 for the 2d month, 24 for the 3th month, 12 for the 4th month, etc... I would like to obtain in my cumulative field :

1st month : 10

2d month : 26

3th month : 50

4th month : 62

etc...

 

Thank you

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use