Conditional expression in query
Posted: 23 Aug 2011 13:34
Hi,
I just came across this function in the manual:
=ItemIf(%INDI.SEX% = 'Male',%INDI.FAMS>WIFE%,%INDI.FAMS>HUSB%)
Which works pretty fine, but then I thought I'd prefer to have the surname first, and then the given name, and tried to change it to this (in two query columns):
=ItemIf(%INDI.SEX% = 'Male',%INDI.FAMS>WIFE>NAME:SURNAME%,%INDI.FAMS>HUSB>NAME:SURNAME%)
=ItemIf(%INDI.SEX% = 'Male',%INDI.FAMS>WIFE>NAME:GIVEN_ALL%,%INDI.FAMS>HUSB>NAME:GIVEN_ALL%)
The terms are accepted by the software, however the result in all three cases is just showing the standard individual form, like John MILLER, in the field.
Also, I tried to apply the same to the RecordID, which I thought should have this form then:
=ItemIf(%INDI.SEX% = 'Male',=RecordId(%INDI.FAMS>WIFE>%),=RecordId(%INDI.FAMS>HUSB>%))
But that term is not accepted at all by the program.
Any ideas?
TIA
Sabine
ID:5406
I just came across this function in the manual:
=ItemIf(%INDI.SEX% = 'Male',%INDI.FAMS>WIFE%,%INDI.FAMS>HUSB%)
Which works pretty fine, but then I thought I'd prefer to have the surname first, and then the given name, and tried to change it to this (in two query columns):
=ItemIf(%INDI.SEX% = 'Male',%INDI.FAMS>WIFE>NAME:SURNAME%,%INDI.FAMS>HUSB>NAME:SURNAME%)
=ItemIf(%INDI.SEX% = 'Male',%INDI.FAMS>WIFE>NAME:GIVEN_ALL%,%INDI.FAMS>HUSB>NAME:GIVEN_ALL%)
The terms are accepted by the software, however the result in all three cases is just showing the standard individual form, like John MILLER, in the field.
Also, I tried to apply the same to the RecordID, which I thought should have this form then:
=ItemIf(%INDI.SEX% = 'Male',=RecordId(%INDI.FAMS>WIFE>%),=RecordId(%INDI.FAMS>HUSB>%))
But that term is not accepted at all by the program.
Any ideas?
TIA
Sabine
ID:5406