Page 2 of 2

Custom queries

Posted: 06 Aug 2012 04:29
by Overloaded
Have you ever used a function in a subtitle? I'm starting to conclude that it's not an option?

Custom queries

Posted: 06 Aug 2012 11:06
by tatewise
Try spelling the function Individual and NOT Individuall (double ll should be single l)

Also, contrary to my earlier posting, PeterR is correct in suggesting the Row filters must be:

Code: Select all

=IsSameItem(FactOwner(,1,MALES_FIRST),Individual(['Person']))
=IsSameItem(FactOwner(,2,MALES_FIRST),Individual(['Person']))
Yes, I have used functions in both Title and Subtitle > Custom and they work fine.
But you cannot use Date codes such as %#x at the same time in the same field.
I am using FH Version 5.0.7

Custom queries

Posted: 07 Aug 2012 04:05
by Overloaded
Sorry about the typo.

Now have this in the subtitle
=Individual(['Person'])

and the filters are unchanged:
Add if =FactOwner(%FACT%,1,MALES_FIRST) is ['Person']
Add if =FactOwner(%FACT%,2,MALES_FIRST) is ['Person']


which printed this in the report:
,1,MALES_FIRST

so, it appears to be attempting a function...

Custom queries

Posted: 07 Aug 2012 10:46
by tatewise
Don't know how you are getting that effect. If I use those settings I get two prompts for Person.

Which FH Version are you running?

As has been said before, the Row filters must be:

Code: Select all

Add if =IsSameItem(FactOwner(,1,MALES_FIRST),Individual(['Person'])) is true.
Add if =IsSameItem(FactOwner(,2,MALES_FIRST),Individual(['Person'])) is true.

Custom queries

Posted: 07 Aug 2012 15:43
by PeterR
Image
The above is certainly working OK for me. The Expressions are pasted below so that you can copy and paste them into FH:

Code: Select all

=Individual(['Person'])
=TextIf(IsSameItem(FactOwner(,1,MALES_FIRST),Individual(['Person'])),'',FactOwner(,1,MALES_FIRST))
=IsSameItem(FactOwner(,1,MALES_FIRST),Individual(['Person']))
=IsSameItem(FactOwner(,2,MALES_FIRST),Individual(['Person']))
Edit: Even better column Expression:

Code: Select all

=TextIf(IsSameItem(FactOwner(,1,MALES_FIRST),Individual(['Person'])),FactOwner(,2,MALES_FIRST),FactOwner(,1,MALES_FIRST))

Custom queries

Posted: 08 Aug 2012 05:27
by Overloaded
Hallelujah!  It works, including the column filter for different name[smile]

Details:
I was running 5.0.0, so I upgraded.  That made my existing filters produce two prompts, both searching the list of individuals.

Copying PeterR's code was non-trivial.  For whatever reason, I can cut-and-paste the expressions he gave into other fields in FH, but not into the fields for the expressions.  Also, if you don't first remove the existing parameter field on the row filter, it just won't accept the new filter :)

Thank you both

Custom queries

Posted: 08 Aug 2012 11:54
by PeterR
Glad you've got the query to work properly at last.  For the Paste, were you trying to use Ctrl-V?  Had you tried the right-click context-menu Paste?