The method can return even a calculated value or the array of calculated values from the values of variables that meet the specified filter, see the assignment of the sWhat parameter.
sWhat | (String) Specification of what to be returned: - "a1;" or "a1;a2;a3;" - If an array of variables of the "Data" tab has to be returned. It is necessary to keep the order of the variables on the tab. For example, if the order of variables is a1,a2,a3,... on the tab, then in the parameter it is possible to enter, for example, "a1;a3;" but "a3;a1" is wrong. - "time;" - If an array of the time has to be returned. Time selection can be changed by entering "time:winter;" and then all time values are returned in the "standard time" otherwise they are in the "local time". - "attr;" - If an array of the record attributes has to be returned. - "*data;" - Mean all data variables except time and attribute ("time;*data;" returns time and all data variables). - "*;" - Returns time, attribute and all data variables. - "avg(xx)" - The method returns the average value of the xx variable from the values that meet filtering conditions specified by the vFilter filter. - "avg(xx;weighted)" - The method returns the weighed value of the xx variable from the values that meet filtering conditions specified by the vFilter filter. The weight of the value is here the length of its duration until the time of saving the next value. - "min(xx)" - The method returns the minimum value of the xx variable from the values that meet filtering conditions specified by the vFilter filter. - "max(xx)" - The method returns the maximum value of the xx variable from the values that meet filtering conditions specified by the vFilter filter. - "sum(xx)" - The method returns the sum of all values of the xx variable from the values that meet filtering conditions specified by the vFilter filter. - "count(xx)" - The method returns the number of values of the xx variable from the values that meet filtering conditions specified by the vFilter filter. |
---|---|
vFilter | (Variant) Value that defines, for example, the time range of the got data (time from, time to, number of points, etc.), possible if the data have to be filtered by the value. It is created by calling the CreateFilter, AddFilter methods. If the sWhat parameter contains the list of variables, then it could happen that for each variable there would be a different number of lines (different number of stored values). Therefore it is necessary to process "lines intersection" - i.e. select only lines common for all variables. If the sWhat parameter contains the calculation function, then the value filters for each variable will be used only for calculating these variables and will not affect calcualtion of another variables. |
If such data don't exist or if an error occurred then the method returns: null for JavaScript or Empty pro VBScript (it can be tested by the Pm.IsValid method).
If in the sWhat parameter is function for calculation, then it returns either the simple value or the 1-dimensional array array of calculated values.
var oTrend = pMe.Pm("/Trends");
var arr = oTrend.GetData("time;*data;", vFilter);