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
* Conditional Expressions in Queries
-
quarlton
- Famous
- Posts: 150
- Joined: 26 Feb 2004 13:07
- Family Historian: V7
- Location: Lincolnshire
- Contact:
Conditional Expressions in Queries
Dave Simpson ~ Boulton, Braham, Carney, Simpson and Jacobs
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Conditional Expressions in Queries
The Column Expression =TextIf(Number(["EnterYear"]) = 1920,"Success","Fail") works fine for me.
That is identical to your 2nd attempt posted below, so I cannot explain why it does not work for you.
That is identical to your 2nd attempt posted below, so I cannot explain why it does not work for you.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
quarlton
- Famous
- Posts: 150
- Joined: 26 Feb 2004 13:07
- Family Historian: V7
- Location: Lincolnshire
- Contact:
Re: Conditional Expressions in Queries
Thanks Mike
I've just tried it for the umpteenth time and it worked!
No idea what went wrong before.
As usual many thanks for your input.
Dave
I've just tried it for the umpteenth time and it worked!
No idea what went wrong before.
As usual many thanks for your input.
Dave
Dave Simpson ~ Boulton, Braham, Carney, Simpson and Jacobs
-
quarlton
- Famous
- Posts: 150
- Joined: 26 Feb 2004 13:07
- Family Historian: V7
- Location: Lincolnshire
- Contact:
Re: Conditional Expressions in Queries
Having got my columns working the way I want, what I would like to do is something similar or rows, but I have a feeling that this is going to be a definet NoNo.
What I would like is to have two filters that use 'and'
Exclude Unless %INDI.BIRT[1].DATE% is null and Parameter = 1900
Exclude Unless %INDI.BIRT[1].DATE% is null and Parameter = 1945
Many thanks
Dave
What I would like is to have two filters that use 'and'
Exclude Unless %INDI.BIRT[1].DATE% is null and Parameter = 1900
Exclude Unless %INDI.BIRT[1].DATE% is null and Parameter = 1945
Many thanks
Dave
Dave Simpson ~ Boulton, Braham, Carney, Simpson and Jacobs
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Conditional Expressions in Queries
That is a definite yes yes:
Exclude unless
=IsTrue( NullDate(%INDI.BIRT[1].DATE%) and Number(["Parameter"]) = 1900)
is true
Exclude unless
=IsTrue( NullDate(%INDI.BIRT[1].DATE%) and Number(["Parameter"]) = 1900)
is true
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
quarlton
- Famous
- Posts: 150
- Joined: 26 Feb 2004 13:07
- Family Historian: V7
- Location: Lincolnshire
- Contact:
Re: Conditional Expressions in Queries
Mike you are brilliant
Dave Simpson ~ Boulton, Braham, Carney, Simpson and Jacobs