QueryImplementingThingsWithNamedPropertyHistory
When QueryImplementingThingsWithNamedPropertyHistory is used in my script I am getting data of all the PUMPS data available on the dashboard, but I need only One Pump data in PIVOT and Code goes like this:
var PropertyName = "PumpRunSignal";
if(PumpName === undefined || PumpName === null || PumpName === '' ) {
var query = undefined;
}
else{
var query = {
"filters": {
"type": "EQ",
"fieldName": "name",
"value": PumpName
}
};
}
var result2 = ThingTemplates["PumpThingTemplate"].QueryImplementingThingsWithNamedPropertyHistory({
propertyNames: {
"rows": [{
"name" : PropertyName
}],
"dataShape": {
"fieldDefinitions":{
"name":{
"name" : "name",
"aspects" :{},
"description": "",
"baseType":"STRING",
"ordinal": 1
},
"description": {
"name" : "description",
"aspects" :{},
"description": "",
"baseType":"STRING",
"ordinal": 2
}
}
}
} /* INFOTABLE */,
maxItems: undefined /* NUMBER */,
tags: undefined /* TAGS */,
nameMask: undefined /* STRING */,
query: query /* QUERY */,
maxDataItems: 500000 /* NUMBER */,
startDate: StartDate /* DATETIME */,
endDate: EndDate /* DATETIME */,
oldestFirst: true /* BOOLEAN */,
dataQuery: undefined /* QUERY */
});
var params = {
t: result2 /* INFOTABLE */,
nameColumn: "name" /* STRING */,
valueColumn: "PumpRunSignal" /* STRING */,
timestampColumn: "timestamp" /* STRING */
};

