Home : Spread Reports - Tips & Tricks
Q13136 - INFO: Spread Reports - Tips & Tricks

How do I get a report that shows the average value for a variable since a certain condition occured?

For example, I want to see the average Effluent BOD since the last time it went above 40. 

1. Find the Varid for Effluent BOD.  In this example it is 37. 

2. Get into Spread Report Design.

3. Click on cell D4, and go to Locate, SQL Results.

4. Enter the following query (replacing the VARID = 37 with your Varid) and click OK.  Assumes your variable is daily and therefore data is in the Datatbl, see WIMS Data Structures for more information.

Select TOP 1 DateStamp FROM DATATBL WHERE CURVALUE > 40 AND VARID =37 ORDER BY DateStamp DESC

5. Locate the Current Date in cell D5 using Locate, Dates

6. In D7, enter the formula =GAVG(4011,D4,D5).  This will return the average for variable 4011 (effluent BOD, Varid 37 in this case) for date range displayed in D4 and D5.

 

Download Example Template: TipAvgSince.hwr (Click here for download instructions)

 

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 8/4/2010 3:18 PM.
Last Modified on 3/17/2014 2:08 PM.
Last Modified by Scott Dorner.
Article has been viewed 3632 times.
Rated 3 out of 10 based on 5 votes.
Print Article
Email Article