Emulación de la función TOTALYTD
The TOTALYTD function is easy to use and allows us to quickly calculate the result of an expression for the period between January 1st and the current context's last date, but sometimes we need more control over the evaluated expression. In this scenario, we will simulate the TOTALYTD function using other functions that would allow us this additional control.
We start with a table called Movements where we find financial movements associated with a date (we will assume that these are sales):