There's a contradiction in your question. "then followed by
the sum of number of all _PREVIOUS_ numbers _BEFORE_ that value.",
and you're still giving "D / A + B + C + D" as an example. So, do
you want to include the _current_ value or not?
Also, you're saying don't want the sum of all previous
numbers, but the sum of _NUMBER_OF_ previous numbers? Eh?
So, first iteration would produce 1, the second 1+2, third
1+2+3, fourth 1+2+3+4, etc?
I'm puzzled, but maybe here's some help:
Assuming we use something like "SELECT databaseValue FROM
myTable" ...
<CFSET sumOfPrevious = 0>
<CFOUTPUT query="myQuery">
<CFSET sumOfPrevious = sumOfPrevious + databaseValue>
#databaseValue# / #databaseValue/sumOfPrevious#
<BR>
</CFOUTPUT>
If I got you wrong, and you want to divide the value by the
sum of all _PREVIOUS_ numbers, move the <CFSET> after the
<CFOUTPUT> line just before the </CFOUTPUT>, so that
the result is printed out first.
If I got you wrong again, and you want to divide the value by
the *sum* of _number_of_values_ (it's sounds insane, I know),
increment the sumOfPrevious by #myQuery.currentrow# each time,
instead of the databaseValue.