Book a Demo

Author Topic: Filtering Elements by Multiple Tagged Values in a Template  (Read 6913 times)

djdejong

  • EA User
  • **
  • Posts: 32
  • Karma: +2/-0
    • View Profile
Filtering Elements by Multiple Tagged Values in a Template
« on: November 02, 2016, 08:13:07 am »
Hey,

I'm trying to use the "Element Filters" in the "Document Options" dialogue of the document editor to select an element satisfying two or more values present in its tagged values table.

Say for element1: tag1 = val1; tag2 = val2. element2: tag1' = tag1 = val1; tag2' = val2'. Could I filter for "val1" and "val2' " to grab only element2 using two separate TagValue filters (I realize it might not be necessary in this simplistic example)?  For some reason my attempts to use two filters at once are returning nothing, despite the element having both the tags I'm filtering for.

Thanks!
Dana

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Filtering Elements by Multiple Tagged Values in a Template
« Reply #1 on: November 02, 2016, 10:58:14 am »
Unfortunately, the element filtering mechanism won't do it. It can only find a single tagged value that matches all the tagged value rules.

You can still achieve the same result by using a custom sql search as the basis for your report. Here's a query you can build on.

Code: [Select]
select t_object.ea_guid AS CLASSGUID, t_object.Object_Type AS CLASSTYPE, t_object.Name, tag1.[Value], tag2.[Value]
from t_object, t_objectproperties tag1, t_objectproperties tag2
where t_object.Object_ID = tag1.Object_ID
and t_object.Object_ID = tag2.Object_ID
and tag1.[Property] = 'tag1'
and tag2.[Property] = 'tag2'

djdejong

  • EA User
  • **
  • Posts: 32
  • Karma: +2/-0
    • View Profile
Re: Filtering Elements by Multiple Tagged Values in a Template
« Reply #2 on: November 03, 2016, 09:00:42 am »
Ah, okay.  That's good to know - thanks!  I'll take a look at that query.

skiwi

  • EA Expert
  • ****
  • Posts: 2081
  • Karma: +46/-82
    • View Profile
Re: Filtering Elements by Multiple Tagged Values in a Template
« Reply #3 on: August 22, 2018, 01:35:22 pm »
This looks really useful to me, I need a similar query where I can filter elements in a model document to include elements where a tag does not exist, the tag is empty, or the tag has a specific value.


But I'm seeing an error (13.0)
"The Microsoft Jet Database engine cannot find the input table or query 't_object'.


Ignore this, I think I had a connectivity issue
« Last Edit: August 22, 2018, 02:00:55 pm by skiwi »
Orthogonality rules
Position and Team disestablished, thanks austerity.
Now itinerant.