Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone
I'm trying to optimize this expression
if (PER=0,
IF(IND=0,sum(Value*coef),
sum(Value*IND*coef)),
IF(IND=0,sum(Value*coef*PER),
sum(Value*IND*coef*PER)))
the thing is it depends on the users selection so can't optimize it in the script, and at the same time pick (match) doesn't work because for example PER can aither be 0 or (0 or 1).same for IND.
Any idea can be helpful,
Thanks in advance
Firt of all Thank you for your answer, It doesn't work because as I said before it depends on the user's selection, so this way won't get the needed result
Thank you the substringcount() is definitly interesting , but In terms of performance for multi million rows it says it didn't change that much from nested IF.
I was wondering if we can do something like this ,pick(match (IND,0,sum(IND)>=1)
I could explain how to use selected values, but as Rob says, if the values of PER and IND are only 0 or 1 then the outcome of your expressions will ALWAYS equal Value*coef
Maybe you could explain with some sample data (numbers)?
It seems to me that
sum(Value*coef)
will give you the same answer as the if() statement.
-Rob
I will try to create a sample application and put it on this forum , since the data model is quite complex, that will help you understand the motivation behind my question.
Thank you for taking time to answer my question