Question EASY: Cumulative Average Expression?

ciw916

New member
Joined
Jun 26, 2012
Messages
1
Programming Experience
Beginner
New to VB.net.

Very basic understanding of SQL.

I have a textbox that displays the sales numbers for month 1-3. In the last column I want to display the ROLLING average of sales numbers for months 1-3.

The caveat: The report will be used DURING the 1-3 month timeframe. Therefore, if the report is ran at the end of month 2, I need the average for only the 2 months that have passed. I don't want to include month 3 in the average if month 3 has not yet occurred.

What is the expression that will keep the denominator dynamic? In excel I would simply write an if statement that calculates the number of months that have passed as the denominator. Doesn't seem to be an option in VB.net. Please help!
 
Back
Top