Skip to main content
1-Visitor
March 1, 2017
Question

QueryPropertyHistory returns partially empty rows

  • March 1, 2017
  • 1 reply
  • 4565 views

Hi,

I just experienced a problem with QueryPropertyHistory when querying data from a thing (logged with a Value Stream). When I select a time interval I'm interested in the result might have rows where some values are empty (undefined). However, if I expand the time frame (set an earlier startTime) the rows that were partially empty are usually filled in and there are new rows with some empty values.

I have understood that writing data to streams is asynchronous but I'd expect that the writing should be done one event (row) at a time. This can happen even if there are minutes between the query start time and the actual first "row" time.

Example (start date X, end date Y):

value1value2timestamp
19just-example-dont-care
28just-example-dont-care
37just-example-dont-care
4just-example-dont-care

Example (start date X - Z, end date Y):

value1value2timestamp
19just-example-dont-care
28just-example-dont-care
37just-example-dont-care
46just-example-dont-care
5just-example-dont-care

Any ideas? This really messes up my system.

<EDIT>

The same happens if I call the QueryPropertyHistory from a service I created or "manually" from the Thing -> Services -> Generic Services -> QueryPropertyHistory. I've changed only the endDate & startDate (query is empty and maxItems is 500).

Could this be related?

</EDIT>

BR,

Risto

1 reply

5-Regular Member
March 2, 2017

Hi Risto Vaaraniemi​,

Are you viewing the result in a Grid on a Mashup or directly Testing the service in the Thing?

If you are doing it on the Mashup; the thread Re: Issue on QueryPropertyHistory could be related.

Also, please confirm the ThingWorx version you are on?

5-Regular Member
March 2, 2017

Please also confirm the Database you are using?

1-Visitor
March 2, 2017

Hi,

I'm using PostgreSQL through "ThingworxPersistenceProvider".

I've called QueryPropertyHistory in my own service and also through the thing -> Services -> Generic Services -> QueryPropertyHistory (not on any Mashups) with same results. I've changed only the endDate & startDate parameters (query is empty and maxItems is 500). Usually I get about 10 to 20 rows of data.

Version: 7.2.5-b56

-Risto