I have in my scripts an expression with variables, which gives wrong results and I want to rewrite it without variables, but I don't know how to write the MIN and Max of Datum, to obtain the results I need.
In the following example I'll explain what I need from MIN and MAX of Datum. As can be seen in the image bellow, the "min Datum" and "max Datum" are calculated for each row, which is NOT what I need. What I need is to have on each row the MIN and MAX of the selected Datum range. So in this case, the dates highlighted in yellow.
Question 1: How do I write that?
Question 2: How do I write the new expression, based on the answer to question 1?
Here are the variables and the expression (to be replaced):