Is testValue a field? It's not defined in your Let Statement.
Where did this come from? Is it a custom function? There is no native function like that. Though there is a Choose function.
Check the smaller parts individually, as well, like you did with the "count" variables.
Or make those a part of the Let variables to make it easier to check.
1 of 1 people found this helpful
To help me develop and analyse complex Let ( ) calcs like this I usually set the desired result up as a parameter, and then reference that at the bottom of the calc. This makes it easy then to examine the outcome of each parameter to spot what may be going wrong—
fCount = ValueCount ( fromList ) ;
tCount = ValueCount ( toList ) ;
rCount = ValueCount ( resultList ) ;
fVal = GetValue ( fromList ; 1 ) ;
tVal = GetValue (toList ; 1 ) ;
rVal = GetValue ( resultList ; 1 ) ;
result = Case(
rCount = 0 ; 0 ;
Sum ( fCount ; tCount ; rCount ) / 3 ≠ rCount ; "Check the tier setup." ;
( testValue >= fVal ) and ( testValue < tVal ) ; rVal ;
Chooser ( RightValues ( fromList ; fCount-1 ) ; RightValues ( toList ; tCount-1 ) ;
RightValues ( resultList ; rCount-1 ) ; testValue )
result //NOTE: to examine another parameter, just substitute its name here
See the top - I'm setting up a custom function and testValue is the last parameter.
Bruce - yes, a custom function - that's what I meant in the top line where it says I'm setting up a CF.
Thanks for the replies, everyone! I guess I may never know which part of my mind was missing...I copied this function into another system and it worked perfectly. No idea why!!
Hmmm, saw a bit of brain running through here earlier, yours?