Home : Products : Hach WIMS : Hach WIMS Client : Documentation : Tips and Tricks : Math Toolbox Functions - Tips & Tricks
Q13134 - INFO: Math Toolbox Functions - Tips & Tricks

This article is intended to show users how to perform calculations that are not explicit or easy to perform using the standard Math Toolbox Functions.

 

Q: How do you calculate (count) the number of values in a WIMS variable Month-to-Date?

A: The answer involves a complex combination of functions, including one "Advanced Math Toolbox" function.  Here is how to do it:

V6 = GETSUM(IF(ISBLANK(C1),0,1),BOM TO #MM/DD/YY)

Quick translation:
V6 = SUM( # Times Variable 1 is not blank) from the Begining OF the Month to Today

Explained:
The GETSUM advanced math toolbox will sum the 1's and 0's from the IF statement from BOM (Begining of Month) TO #MM/DD/YY, which is the current date being calculated (see Date Literals for more information on that).  The IF statement checks to see if the variable C1 (variable 1) is blank or not. If not, then we count it.

NOTE: We can manipulate the Date Literals to Get counts from the begining of the quarter (BOQ) to today, or any other date range you may need.

In Spread Reports, we have a function called GNOS which is specifically designed for this purpose, but if you need it in Math Toolbox (calculated variable), use the above equation.

 

Q: How do you calculate a value only on the last day of the month?

A:  Use TODAYIF and Date Literal of #MM/LL where MM means any month and LL means last day of the month.   

=TODAYIF(#MM/LL,MOV365(C1),BLANK) - Will calculate the 365 day moving average for variable 1 on the last day of each month

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 2:54 PM.
Last Modified on 11/7/2018 1:29 PM.
Last Modified by Scott Dorner.
Skill Level: Intermediate.
Article has been viewed 3661 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article