How to query a datatable on both date and time basis.
Hi,
I have a use case where devices are sending data in JSON format to a broker server and from that broker server we are receiving data to data tables of thingworx through a service.
say we are receiving data for temperature, now I need to generate a time series graph that will display temperature data between the hours of 9 AM to 3 PM, also user will filter data by enter minimum date and maximum date.
So to display filtered data on graph I wrote the following service:
var query = {
"filters": {
"fieldName": "timestamp",
"type": "BETWEEN",
"from": minDate, // Input parameter for minimum date
"to": maxDate // Input parameter for maximum date
}
};
var values = me.CreateValues();
var params = {
maxItems: 500 /* NUMBER */,
values: values /* INFOTABLE*/,
query: query /* QUERY */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
};
// result: INFOTABLE dataShape: "undefined"
var result = me.QueryDataTableEntries(params);
This service is filtering data on the basis of minimum and maximum dates passed by user as Input parameter. Now I am not getting how do I apply filter so that the service will display data only for hours between 9 AM to 1 PM for the input range of date passed by user.
for e.g
I want to display data from 1 september to 13 september only for hours 9 AM to 1 PM for temperature.
1 september and 13 september is passed by user as input parameter.
Looking forward for help.
Thanks,
Meenakshi

