DDV returns values for Daily Detail variables (i.e. hourly, 15 Minute…)
SYNTAX:
DDV(VarNum,offset/date, Optional Interval, Optional IntervalNumber)
VarNum: The variable number to get the value for.
Offset/Date:If the field is numeric it is assumed to be the offset and is defined as the offset (number of slots for the variable type) from the start date of the report. For example, if the start date is 1/1/2000 and the offset is 2 the value for the 2nd data slot will be returned. I.E. for an hourly variable the value for the 1AM to 2AM slot will be returned, for a 15 minute variable the value for the 12:15 AM to 12:30AM slot will be returned. If the offset is 3, the value for 2AM to 3AM (hourly var). If the field is a date/time in quotes or a cell reference to a cell containing a date/time the value for the slot specified by the date/time will be returned.
Interval OPTIONAL. Used to retrieve data outside the report date range. The interval sets whether to go back/forward years (yyyy), months (m), etc… The following are the valid settings for Interval.
Interval |
Description |
yyyy |
Year |
q |
Quarter |
m |
Month |
y |
Day of Year |
D |
Day |
H |
Hour |
n |
Minute |
w |
WeekDay |
ww |
Week |
IntervalNumber: Used with the Interval Setting to set the date to get the comment for. Sets the number of Intervals to be added to set the dates. See examples below.
NOTES:
In Design, Spread Reports use Locate, Daily Detail Values to place this formula on a report.
EXAMPLES:
Start Date of report is 1/1/2000
Variable 1 is an hourly parameter
DDV(1,1) Retrieve value for 1st Slot (hour) of 1/1/2000
DDV(1, “1/1/2004 03:22 AM”) Retrieve value for the 3AM hour on 1/1/2004. NOTE: Will get data outside of date range of report
DDV(1,3,"m",2) Retrieves value for 11/1/1999 2AM - Offset of 3 gets the 2AM to 2:59AM Hour Slot, go back 2 months (m).
DDV(1,A4) A4 contains "12/25/99 4:22AM". Retrieve data for the date/time in cell A4. Since Variable 1 is an hourly variable, the 4AM hour slot is searched for a value (not just a value at 4:22 AM).