Returns the stored data from the range specified by the vFilter parameter. According to the way of creating vFilter, either all data are returned or values are filtered if the filtration is used by AddFilter.

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.

Array **GetData**(String **sWhat**, Variant **vFilter**)

`arr = oTrend.GetData(sWhat, vFilter)`

sWhat | (String) Specification of what to be returned: list of variables whose value has to be returned. - "a1;" or "a1;a2;a3;" - If an array of variables of the "Data" page has to be returned. It is necessary to keep the order of the variables from the page. For example, if the order of variables on the page is a1,a2,a3,..., 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 setting 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. function for calculation whose final value has to be returned. The functions can be concatenated by the ; char, for example "avg(a1);min(a1)". The following functions are supported: - "avg(xx)" - The method returns the average value of the variable xx from the values that meet filtering conditions specified by the vFilter filter. - "avg(xx;weighted)" - The method returns the weighed value of the variable xx 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 variable xx from the values that meet filtering conditions specified by the vFilter filter. - "max(xx)" - The method returns the maximum value of the variable xx from the values that meet filtering conditions specified by the vFilter filter. - "sum(xx)" - The method returns the sum of all values of the variable xx from the values that meet filtering conditions specified by the vFilter filter. - "count(xx)" - The method returns the number of values of the variable xx from the values that meet filtering conditions specified by the vFilter filter. WRONG. |
---|---|

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 If the sWhat parameter contains the |

Returns requested data as 1- or 2-dimensional array of values.

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 sWhat is function for calculation, then it returns either the simple value or the 1-dimensional array array of calculated values.

Statistical operations over the data field can also be done by the Pm.ArrayOper method.

See examples in the CreateFilter and AddFilter methods

Send page remarkContact responsible person