Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of Arrays and Calculating Summations

Status
Not open for further replies.

aap96126

Technical User
Apr 15, 2005
13
GB
Hi I am a relative novice in CR so should be grateful for any help.

I have three fields from my database: the month, fees for each month and number of members for each month. I want to try to index the month via some integer i, say, so that Jan 2000 = 1, Feb 2000 = 2, etc. My fees for each month are then F(i) and the number of members is M(i). Using these arrays I then have to calculate certain quantities which depend on summing up the previous twelve months' figures. For example, one quantity is the sum of the previous 12 months fees, call this R(i), so that

R(i) = sum_{j=0}^{j=11) F(i-j).

In words: the sum from j=0 to j=11 of F(i-j).

Does anyone know of a way which uses arrays and some loop which would allow me to do this? My experience of arrays especially is not what it should be.

Many thanks for your help.


 
I've never used arrays in Crystal. You can do running totals that use a selection formula: does this help?

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top