How to display the number of Date that "true" continues the longest in a row


I hope to display the number of dates that "true" keeps going the longest in a row in Aggregate.

For example, If IsHachiji is true for six consecutive days from August 20th to 25th, 6 shows in Expression I pointed with a red arrow.

It would be appreciated if you could give me any advice.


If you have any questions, just feel free to ask me.I need your help.


Best regards,

Hi,

To display a value of an input or local parameter you can use an expression widget. If the value is calculated as you do in your preparation, you do not need to do anything extra.

If you calculate the value in a screen action then you would have to do an Ajax refresh of the expression widget or one of its containers.

Regards,

Daniel

From the IF widget you should back the arrow to the Loop, not to end widget.

Hi,

I miss understood your question that's why I edit my answer. You can use what others said to solve your problem. The only scenario I would do something different than what was suggested is in the case that the entity keeps growing indefinitely. if that entity has thousands of rows I would prefer do all the calculations in the database with something like this.


Regards,

Marcelo

Solution

Hi Tsubasa,

Your True branch looks ok.

You need one extra local variable in your screen called something like 'LongestContiniousDays'.  In your False branch set LongestContiniousDays to max of current and longest and reset current to 0. 

And like 'this' already said, your false branch should cycle back to the ForEach.

And like Daniel said, use expression to show value of LongestContiousDays in screen.

Dorine


Solution