I’ve these two formulas :
All works but I’d like to provide a button to switch from one to the other, so I created a simple measure :
I’ve an error message ( The calculation operated on Level Aware Calculation (LAC) agg expressions is not valid).
Do you know how to write correctly this “if”?
May 16, 2023, 1:58pm
Are you sure that both of these calculated fields work in a visual?
Is this error coming up when trying to calculate the calculated field or when you try and add it to a visual?
Yes, both calculated fields work,
the issue is when I create the calculated field, by the way it works if I write something like
ifelse(test,calculation1, NULL) or
ifelse(test, calculation2, NULL) but not when I write
ifelse(test, calculation1, calculation2)
May 16, 2023, 2:28pm
When you add these calculations to visuals what is the aggregation it shows?
They should both be custom.
@Max Hello ^^,
yes they both have (Custom) aggregation by default.
Please try using the LAC-W variant for this use case - avgOver, minOver with PRE_AGG mode.
I’m marking this as solution for now. Please let us know if you have more questions.
it’s seems to work
I still don’t understand why it works with this solution and not with the other type of LAC
But thanks a lot anyway ^^