News:

If you want to report a bug 🐞 please contact dpost@mvc.on.ca

Main Menu

Query n most recent entrees within period

Started by cmcguire, April 19, 2018, 02:13:03 PM

Previous topic - Next topic

cmcguire

Regarding KIWIS queries, would it be possible to query the n most recent results in a given time period?  We use KIWIS queries to pull data into a planning excel sheet, and we would ideally like to be able to pull the most recent data as of a specific date in the event that we need to reupdate that date's data for whatever reason.  We specifically need this for querying our staff gauge readings, as these do not get updated in a predictable manner (a given gauge may be updated after a week one time, a little over a week another time, and a little under a week on a third occasion).  The simplest way to accomplish this would be to request the most recent value within the requested time range, but KIWIS does not appear to be able to do this. 

I was wondering if this was in fact possible with the current version of KIWIS, or, barring this, how difficult adding this functionality to KIWIS would be at this point in time?  @SteveWKISTERS

- T Daniel Dickson

SteveWKISTERS

Hi Chris,

I'm not sure what the latest functionalities of KiWIS are and have put this question to our support team for their input. I'll update this reply with the information provided.

Cheers,

Steve with KISTERS

SteveWKISTERS

Morning,

See below for response from support. It does not seem like the exact functionality you're looking at is available.

----------------------------------------------

Morning Steve,

This is what I found so far.

Last value in general for the whole period:
http://localhost:8080/KiWIS/KiWIS?service=kisters&type=queryServices&request=getTimeseriesValues&datasource=0&format=html&ts_id=790010


Get the last recorded value from specific date (cannot get the last value, but can only limit the period of showing the data - last our of the day for example):
http://localhost:8080/KiWIS/KiWIS?service=kisters&type=queryServices&request=getTimeseriesValues&datasource=0&format=html&ts_id=790010&to=2018-02-24&period=P1H

Get the last value from the morning of specific date:
http://localhost:8080/KiWIS/KiWIS?service=kisters&type=queryServices&request=getTimeseriesValues&datasource=0&format=html&ts_id=790010&from=2018-02-24&period=P10H (cannot get the last value, can only limit the period of showing the data - morning time for example from 12AM to 10AM)