Home : V
Q10717 - INFO: V
V returns the daily value for a variable.

SYNTAX:

V(VarNum,Offset/Date, Optional Interval, Optional IntervalNum)

VarNum:  The variable number to get the average for.

Offset/Date: If the field is numeric it is assumed to be the offset and is defined as the offset from the start date of the report.  For example, if the start date is 1/1/2000 and the offset is 1, the value from 1/1/2000 will be returned.  If the offset is 2, the value from 1/2/2000 will be returned and so forth.  If the field is a date in quotes or a cell reference to a cell containing a date the value for the date will be returned.

Interval:  Used to retrieve data outside the report date range.  The interval sets whether to go back years (yyyy), months (m), etc…  The following are the valid settings for Interval

yyyy    Year
q         Quarter
m        Month
y         Day of year
D        Day
w        WeekDay
ww      Week

IntervalNum:  Used to retrieve data outside the report date range.  The interval number set the number of Intervals to go back. 

NOTES:

In Design, Spread Reports use Locate, Daily Values to place this formula on a report.

EXAMPLES:

(Report dates are set to Start Date of 1/1/2000 and End Date of 1/31/2000)

Equation Var#    Date to Retrieve Explanation
V(1,1) 1 1/1/2000 Retrieve date for the first day of the report (i.e. offset of 1)
V(1,"1/1/1999")           1 1/1/1999 Retrieve data for passed date string, will get data outside of date range of report
V(1,1,"m",2) 1 11/1/1999 Retrieve passed date string, will get data outside of date range of report
V(1,31,"m",2) 1 None No value returned.  Date is undefined.  Offset of 31 sets date to 1/31/2000, go back 2 months and get date 11/31/1999.  Date does not exist, no value returned.
V(41,15,"y",3) 41 1/15/1997 Offset of 15 sets date to 1/15/2000, then go back 3 years (y).
V(1,A4) 1 ? Retrieve data for the date in cell A4. Since it is a reference to a date and not an offset data will be retrieved whether the date is in the date range of the report or not.
V(1,0) 1 None

The Offset must return a date within the report date range.  Therefore, 0 would be 12/31/1999 which is outside the date range.  No value will be returned.

V(1,"12/31/1999") 1 12/31/1999 Retrieve data for passed date string, will get data outside of date range of report
V(1,32) 1 None

The Offset must return a date within the report date range. Therefore, 32 would be Feb 1st, 2000 which is outside the date range. No value will be returned.

V(1, B4) 1 ? If B4 contains a date, value for that date will be returned.  If B4 is a number it will be treated as an Offset.  If the date calculated with the Offset is within the date range of the report a value will be returned, if the date calculated is outside the date range of the report a value WILL NOT be returned.

 

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...
to move back in time shouldnt either the offset or the interval be negative? is it really programmed to look back by default? seems odd. Approved: 8/10/2009 6:45 AM
Created on 2/8/2008 7:19 AM.
Last Modified on 8/5/2015 3:08 PM.
Last Modified by Scott Dorner.
Article has been viewed 5621 times.
Rated 4 out of 10 based on 5 votes.
Print Article
Email Article