Skip to main content
13-Aquamarine
July 31, 2024
Solved

Influx DB QueryNamedPropertyHistory Doesn't Get Correct Values of a Boolean Property

  • July 31, 2024
  • 1 reply
  • 2788 views

Hi all,

 

I am experiencing some weird behavior with querying property history from the influx DB in thingworx. I am querying several properties at the same time within a time range, some of these are numeric and some are boolean. For the numeric ones I am getting good correct data, but for some of the boolean values the query shows no history and has it as blank. However, the booleans when queried individually show property history and have been flipping between true and false consistently. 

 

I am not sure why this is occurring exactly since the properties have good history but it doesn't show when querying several properties. (I am doing one bigger query because I have a lot of properties that need to be queried in my service).

 

Any feedback is appreciated!

Best answer by VladimirRosu_116627

I advise not to use the query object, in case you're speaking of that (I'm not 100% sure).

That query process is always applied at ThingWorx's level, after the initial result is retrieved from the persistence provider database itself.

It's better to limit that initial result with start/end dates, and maxItems, than to apply a query. That's why you see the query:undefined in my code.

 

1 reply

13-Aquamarine
July 31, 2024

Added note (I think this is the cause of my issue but I don't know how to work around it) I am seeing a data loss issue when querying properties and using a time range. First image I query this property with a time range and get nothing. Second image I use no time range and you can see that there is value history but I can't get it to query it if I use a time range. Any ideas on how to get around this?

 

 

 

 

 

19-Tanzanite
August 1, 2024

Hi @JK_10744682 

In the screenshots above, the date time range you used for searching does not include any values that are visible in the second screenshot.

Why would you expect values then in the first query execution?

13-Aquamarine
August 1, 2024

You are correct that there aren't any data changes, however the property still had a value during that time range of either true or false and I need to be able to get what the value was during that time range. I think I resolved that part at least by just removing the startDate and getting the most recent value since endDate. I'm just finding that if I query a lot of properties at once and want the values for a specific time range, if there isn't a data change for a property within the time range then no value is returned, rather than returning a row with the actual value at that time which is annoying.