Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using variables with arguments to hold my expressions which are used through my application. I pass the variable the respective field to be calculated which works just fine. However, I cannot find a way to pass a function via the argument into the expression without error.
Working example (in simple terms, where Num is the field that holds values):
Normal expression: sum(Num)
Variable for expression: vCalcSum = sum($1)
Called in expression: =$(vCalcSum(Num))
Problem example; I cannot find a way to pass a function to the same variable, in this case using if():
Normal expression: sum(if(Type=1,Num,0))
Variable for expression (same as above): vCalcSum = sum($1)
Called in expression: =$(vCalcSum(if(Type=1,Num,0)))
I have tried using $ expansion on the inner logic to no avail and am stuck. Thoughts, ideas, tricks??? Thanks!
Try set analysis: $(vCalcSum( {<Type={1}>} Num ))
Thanks. For the simple if() in my example I can use set analysis, but I guess I was looking for a more comprehensive solution that would work for any type of function. Maybe a better example would have been:
if(Type=1,Num,Num*2)
But then again, maybe I'm overthinking this!