can someone tell me if it is possible to get an dynamic offset within the periodOverPeriodDifference function?
Doenst matter if it is a calculated field or a ifelse direct in the function itself.
To clarify do you mean that you want to be able to choose the two different years and then the year difference between those creates your offset in the calculated field? For example, if I choose 2023 and 2020 my offset would be 3 years.
Thats something i already tried. Calculation in a field in the formula itself. But looks like the only thing thats working is a parameter or fix value.
i guess i have to build a ifelse around with the calculation for every potential diff.
Error: “At least one of the arguments in this function does not have correct type. Correct the expression and choose Create again.”
When I create a calculated field with just the dateDiff part, I am getting an int. I have also tried to wrap the dateDiff in a min and minOver, with the same result.
apparently you can only use hard values or parameter as an offset and not calculated values.
A workaround could be that you put an ifelse infront of periodOverPeriodDifference basiclly:
ifele(dateDiff(${DeepDiveDateParam1},${DeepDiveDateParam2},‘MM’) = x, periodOverPeriodDifference(sum({# Assets}), {Month}, MONTH, x)… and so on.
It would become a really large calculated field, depending on the number of possible offsets.
If you have any questions feel free to ask.
But dynamic offsets could be cool feature in the future.