AINFO returns the value/text stored in the Additional Info table for the VarNum/DateTime specified. The date time is set by the Offset/Date, Interval and Interval-number fields.
AINFO(VarNum, Offset/Date, Field, Optional Interval, Optional Interval Number)
VarNum: is the variable number
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.
Field: Sets the Field (Column name) in the Additional Info table to return data from. Field must be in quotes (i.e. “SAMPLEID”)
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
y Day of year
IntervalNum: Used to retrieve data outside the report date range. The interval number set the number of Intervals to go back.
AINFO(11,1,”SAMPLEID”) Return the SampleID from the Additional Info table for variable 11 for the 1st day of the report.