Ubidots Community

[SOLVED] Finding min, max not working


I need to find the min/max value of a variable for further calculation, this gives me odd results.

Lets say I want the max. within the last 7 days.
So I create a rolling window with “max”, “every 7 days”, starting from date ‘today - 7days’.

Instead of getting now the max values I get odd results, but the max.

I need this value somehow to make percentage calculations in a derived variable.

Is there any solution for this?

Thanks Sam

Hi @universam,

We are looking into helping you, will get back to you once we have an answer.

all the best,
Catalina M.

Hi @universam,

I just check the rolling window and it works fine, please take a look what I’m doing:

1- Create Rolling window Max

2- Create Rolling window Min

I’m posting a value to TestRolling

They look like this because I only have one value

I post a min value 72

Here you can see the value of the rolling window max of the variable TestRolling

I post a max value 347

Here you can see the value of the rolling window min of the variable TestRolling

All the best,
Catalina M.

1 Like

thank you @kath for your efforts to explain, appreciate this.

Not sure why it does not work for my setup. I will start from scratch again.

Perfect @universam

Hi @kath
Sorry to say, but it is clearly broken in my config. While I can reproduce your example fine, in my real data this is not working as expected.

At the beginning of the data series I have a high value, this one I want to retrieve. But there is no way to ‘catch’ this value. So as example the data series is 3 days old, but even if I specify 7 days interval for MAX value it is not catched, but some smaller, newer values are taken. Indeed it is ‘catched’ once, but immediately overwritten by a smaller number- Makes no sense to me. I tried it several times with different data series.

Feel free to check my account to shed light into it.
Thank you

Hi @kath

Unfortunately, there is really a bug in that function if you are setting a longer period. It is impossible to get a max value over a period of lets say 7 days.
So creating this rolling window, max over 7 days gives following result, you can clearly see this makes no sense, it should stay on 51!

This is the data source:

Please have a look at that!

Thank you

I noticed that min/max is not working ok when widget is added. After editing it again it works ok.
Somehow it is set to Last value after creating it.

Best regards

Hi @universam @sampi,

We will reproduce the issue and inform you once we have an answer.

All the best,
kath :relaxed:

Hi @universam,

Could you check the time range please ? y look that is not the same

Rolling window


All the best,

Hi @kath

Sure I just recreated the rolling window as a Max of 7 days.

The source:

Then I created the Max rolling window over 7 days, clearly it should display something around 17, right!?

Here is then the result of the max rolling window over 7 days:

makes no sense, right