How to retrieve historical information in details

@Bart_Verhaeghe,

Where do you want to retrieve this information? In the account template, or do you want to retrieve it somewhere else?

Part of your solution is in here, if you want to retrieve it somewhere else.

And I don’t get your example; shouldn’t it be 100+50+60 = 210? :thinking:

Whatever your object is where that data is stored for each stock movement, you’ll need to go over your collection again with a for-loop, and put an if-statement in there that adds the cumulative amount in a register. That register can be used for the total amount.

For example (this is just quickly an example) :

{% fori stock in custom.stocks %}
| {% input stock.date as:date %}  | {% input stock.value as:currency %}
{% endfori %}

{% t "Input date calculate stock value" %}
{% input custom.date.calc as:date %}

{% for stock in custom.stocks %}
{% if custom.date.calc > stock.date %}
{% $1+ stock.value %}
{% endif %}
{% endfor %}

{% t "Stock value =" %}{{ $1 | currency }}

Can you try with this?