Conditional Expressions in Queries
Posted: 12 Oct 2021 14:08
Is it possible to incorporate a Parameter into a conditional expression?
e.g.
I have a Parameter called 'EnterYear'
The value entered in 1920
What I want to do is do a conditional expression that displays different values depending on the Parameter value.
e.g.
=TextIf(["EnterYear"]=1920,"Success", "Fail")
FH won't accept that.
So I thought that I might need to convert the value to a number for it to evaluate properly.
I tested the conversion as below:
=Number(["EnterYear"])
The expression evaluates correctly and displays the value 1920 in the appropriate column.
However, incorporating into the conditional expression wasn't acceptable.
=TextIf(Number(["EnterYear"])=1920,"Success", "Fail")
So it would seem that the Parameter is acceptable in some cases, but not others.
I have had a look through FH Help and Mike Tate's posting in the KB 'Understanding Expressions' but couldn't find a solution.
Can anyone confirm that either it is not possible, or suggest a solution.
Many thanks
e.g.
I have a Parameter called 'EnterYear'
The value entered in 1920
What I want to do is do a conditional expression that displays different values depending on the Parameter value.
e.g.
=TextIf(["EnterYear"]=1920,"Success", "Fail")
FH won't accept that.
So I thought that I might need to convert the value to a number for it to evaluate properly.
I tested the conversion as below:
=Number(["EnterYear"])
The expression evaluates correctly and displays the value 1920 in the appropriate column.
However, incorporating into the conditional expression wasn't acceptable.
=TextIf(Number(["EnterYear"])=1920,"Success", "Fail")
So it would seem that the Parameter is acceptable in some cases, but not others.
I have had a look through FH Help and Mike Tate's posting in the KB 'Understanding Expressions' but couldn't find a solution.
Can anyone confirm that either it is not possible, or suggest a solution.
Many thanks