Finding the Maximum Number in Cumulative NET P&L Column

In my trading app, users can register their trades. I have an additional column that calculates the cumulative NET P&L. For example, the first trade has a value of 59, and the next trade is (-187.5), so the cumulative result is -128.5. Then, the next trade is -87, so the cumulative result becomes -215.5. And so on, I’m using this:

Screen Shot 2023-06-10 at 10.54.30

Now, I need to find the maximum number (Accum Max) in that column. How can I achieve this? I’ve tried using the ‘range’ function, but I haven’t found the correct sequence.

I run a workflow on the text “Accum Max”, so when user clicks it, it adds the current accum number to a state (list). and then I can display the max value in that list.

How can I do this without the user adding every accum value to the list? Its a report.

Is there not an operator for numbers that is Max?

Screen Shot 2023-06-11 at 1.13.12 PM

no.

Does anyone know if I can use any of these plugins to solve it?

http://forum.bubble.io/t/new-plugin-bdk-repeatinggroup-tools/43953/120

Another way is to have hidden inputs with initial content 0. Then with a workflow in a button, change its initial content via change of state. But how can I add the value of all the inputs to the state list?


Hi, I have done this exact feature using the list sorter plugin,. This plugin allows you to sort your repeating group based on calculated fields that are not stored in the database (such as the maximum and minimum values.

I think that it’s exactly what I need. One quick question, can I access the max value, not just sort the list, but actually pull that value to show it in another text field?

I’m not ready to upgrade my app to a subscription plan. But since it can be done, I can do it later.
Thanks Adam

Yes @rodrigo.arce.valdez , using the bdk plugin, you could then just take the 1st item of the list (if you are sorting from max to min), which would be the max value if that makes sense.

I found a better solution (free), using
https://bubble-essential-plugins.bubbleapps.io/version-test/current-cell?debug_mode=true

Just add the plugin element, then set a condition with custom state to add the value to the input, then trigger the workflow when the condition is met. You can refer the input in each cell with the plugin.

This topic was automatically closed after 70 days. New replies are no longer allowed.