Assuming your "Title" field is Software::Title
Write this in the "hide" section:
Case ( PatternCount ( Software::Title ; "VMware" ) = 0 ; 1 ; 0 )
Otherwise, if you want to combine many fields (Other then the "Title" field) , you must add a condition for each field, or make a calculation field that includes all the fields among which you want to search your pattern.
Hope that will help solve your problem.
Nehme: no, that cannot solve the problem.
The calc, which occurs in the parent (computer) record must account for the list of titles installed.
Your calc evaluates only the first related title.
This is one approach that uses the list function to deal with the set of related titles:
NOT PatternCount( List( Software::Title ); "VMware")
There is also a little bit of ambiguity in the way OP described the software title field.
He mentioned title fields. Plural. Did he mean that a single record in the Software table may have multiple "Title" fields?
Or does each Software record only have one Title field; but there may be multiple related records.
Yes it is not clear.
And this is why I gave him the option that helps him of adding multiple fields.
And yes it is not clear.
I thought in fact that this field is included in each portal.
If not, your suggestion will easily solve his problem.
And if he has multiple fields, he could use the "case(..." option
why not just use Title Not = patternCount(Title; "VMWare")
instead of of using not use the crossed out equals sign
IN the hide object when field.When the Title field doesn't include the quoted text it is hidden other wise it shows
If he has multiple Title fields, he should redesign to eliminate them. But it sounds like a more comprehensive description of his schema would be helpful.
isempty ( FilterValues ( SOFTWARE::Title ; "VMWare" ) )
Again: that won't work.
It will only deal with the first related record.
Also, it assumes that the software title strictly == "VMWare".
I wonder if it is ever "VMWare 1.x" or any other variant in which VMWare is part of the title but not the entire title.
If I get it right, what you want is actually prevent a portal line to appear when a specific situation occurs. This is more than just making the entry "blank", because you don't want it to appear in the first place.
You can achieve this by
- modifying the relationship (which sux)
- setting a portal filter
choose the option that does not suck.
Thanks for the suggestions everyone.
The object being hidden is outside the portal. It is a field in the Computer table to indicate the name of the guest computer installed in VMware on that host computer. This field is only applicable when the host computer has VMware installed.
The Software portal has multiple related records, each pertaining to one piece of software being installed. The Software table only has one Title field. The reference to "title fields" (plural) was in reference to the individual title field within each of the multiple related records in the Software portal.
I initially designed "Title" and "Version" as separate fields (i.e. "VMware" and "6" or "7") but found that was more cumbersome than simply including the version number in the Title field (i.e. "VMware 6" or VMware 7").
I'll have a look at the solutions described above next week when I have another chance to work on this database. Thanks again for all the suggestions.
Again, that doesn't work as mentioned before because of the use of a single field to contain variants, eg VMWare 6.
Thanks correct, Bruce, it would not work in a field with versions. That's why the demo contains a separate field for versions. In my opinion, there are too many possible naming variables to try and create an algorithm for each. Creating a separate field for the version seems to me to be low hanging fruit - it is simple, easy, understandable, and it works.
Or you could use the calc I supplied in reply #2. Not clear what you have against this.
I would add a field to the software table of type. For VMWare it would be something like Virtual OS. I say this because if you went with parallels at some point the database wouldn't work. Or if for some reason VMWare changed the name.
a. make a relationship on type where the key is Virtual OS. then you could just do ValueCount ( List ( software::type ) )
b. do Execute sql( "SELECT Count (type) FROM software WHERE type = ? and id = ?" ; "" ; "" ; "Virtual OS" : computerId )
option b doesn't require another TO.