Page 1 of 1

Max/Min by Dates

Posted: Tue Nov 11, 2014 3:08 am
by Saltwater USA

Hi,

Instead of showing all data from JSON array,
I want to retrieve only the max/min "v" and the "t" that is associated with the max/min "v".

t= time, v=height

How can I achieve this?

Thanks!

Image


Max/Min by Dates

Posted: Tue Nov 11, 2014 4:22 am
by Yurii Orishchuk

Hi Saltwater,

You can get min or max value with separate services.

So you should use two services for this goal.

1 With parameters:

pre

sort = yourField
limit = 1

/pre

2 With parameter:

pre

sort = -yourField
limit = 1

/pre

These two request will return your min and max value.

See more about sort and limit parameters for list service here:

http://devcenter.appery.io/documentat...

Regards.


Max/Min by Dates

Posted: Tue Nov 11, 2014 4:50 am
by Saltwater USA

Hi Yurii,

I added "sort" parameter to my request, but it does not work.

What could be an alternative option?


Max/Min by Dates

Posted: Wed Nov 12, 2014 12:48 am
by Yurii Orishchuk

Hi Saltwater,

That should work.. Show us screen shots with "Settings", "Request" and "Test"(with test response) tab.

Alternative solution - to use Server code. But it's more difficult to implement in comparison with the solution above.

Regards.