Home : Using Text Variables in calculations and graphs
Q14485 - INFO: Using Text Variables in calculations and graphs

WIMS cannot calculate a Text Result, only numeric (or numbers with symbols/data qualifiers).  However, you can refer to Text Parameters in your calculations.

WIMS stores the Text Value and a numeric value in the database when entering a Text Parameter.  The numeric value stored depends on the Text Var Format Option set on Edit/View Variables, Text Options Tab.

Text Var Format:

Text Entry:  This format allows any text to be entered, there is no list defined.  The numeric value for any entry will be 1 (one). 

Drop Down List: The value will be the row number of the list item selected.  For the Weather Observation variable shown below, if Sunny is selected the numeric value stored will be 1 (one).  If Partly Sunny is selected, the numeric value will be 2 (two), and so forth.  Therefore, Cold would be 9 (nine).  The Drop Down List (unlike Drop Down Limit to List) allows users to enter values that are NOT on the list.  Those values store a 1 (one). 

Drop Down Limit to List:  The value will be the row number of the list item selected.  Limit to List means a value MUST be picked from the list.
   
Example:  Use the Audit Trail function to verify the numeric value stored:
 

Date Entry: A valid date must be entered.  It will be formatted as mm/dd/yyyy (or dd/mm/yyyy, etc... depending on your Windows regional format).  The numeric value stored will be the Date Serial Number.

Time Entry:  A valid time must be entered. Time can be entered as military time or regular time.  The numeric value stored will be the Date Serial Number.  Note it will set the date portion (integer part) of the date serial number to the date the time is entered for (i.e. if 14:52 entered for Jan 11th, 2021 the numeric value stored will be 44207.62). 

Date/Time Entry: A valid date/time must be entered. The text value will be formatted as mm/dd/yyyy hh:mm AM/PM.  Time can be entered as military time or regular time.  The numeric value stored will be the Date Serial Number.  If Jan 11th, 2021 14:52 is entered the numeric value stored will be 44207.62). 
 
Example 1: Count sunny or partly sunny days.

IF(V941=1 OR V941=2,1,BLANK) NOTE: TEXTEQ function could also be used.

 

 

 

Example 2: Use of ISBLANK, LV, and simple assignment with Text Variables.

 

 

Example 3: Graphing Text Variables

A Time Series graph will plot the numeric values.  Therefore you can see the change of state of the text variable on a graph:

Example 4: Calculate the number hours between two datetimes

V914 is a Text variable with the Text Var Format set to Date/Time Entry.  V915 is setup with equation:

V915 = (V914 - LV(C915,7,-1)) * 24

 

 

 

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 2/9/2018 1:11 PM.
Last Modified on 1/27/2021 5:05 PM.
Last Modified by Scott Dorner.
Article has been viewed 2758 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article