Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
Due to performance issues, I aimed to replace the nested if
with Pick
and Match
, but encountered problems. I used the following formula in a column's background color: pick(match(($(variable) > 10000), true()), red(), green())
. However, this approach didn't work as expected. When I tried using an if
statement instead, I obtained the correct results. Any insights into what might be causing the issue?"
Thank you in advance.
@RanOuerg Not sure the use of True() here. perhaps this?
pick(match(($(variable)) > 10000)+1, green(), red())
i remplaced true() with 1 but it still not working
Pick(Match()) will generally perform no faster or slower than an if(). If the if() function works for you, I would go with that. If this is causing you performance issues, the issue is likely in the $(variable) expression.
-Rob
Understand, but why it not working ? what is the issue with my formula
Your match() could result in two values - 0 for a non-matching and 1 if the variable-comparing returned true(). The 0 couldn't be fetched from pick() because their index starts with 1. To comprehend it I suggest to split it into several parts, like:
$(variable)
$(variable) > 10000
match(($(variable) > 10000), true())
beside each other.
i don't see how can i split my formula, i don't really understand your solution.
Thank you for adding more details please?
Just use each part as an own expression within a table-chart. Each nested expression is resolved starting from the most inner expression-part and then next wrapping one takes the result as parameter and performed the own calculation with it.
The aim by separating all expression-parts is to comprehend the single results and their evolution within the expression-chain to detect logically issues which will occur if the results are unexpected in any way.