We have created a MetaAssociation between Concept and Application. So we can link several Application to one Concept and associate a value to these links: "CRUD", "RU", etc...
We would like to create a query in order to list all Concepts linked to at least 2 applications with the Association value = "CRUD"
We made several tests:
- Select [Concept] Where [Defined object]:[Application].[Airbus - Application Concept] = "CRUD" HAVING COUNT > 1
Not good: list all Concepts linked to several Applications, one of which is linked as "CRUD"
So we tried to group the condition as explained on MEGA doc but does not work with "having count" operator:
- Select [Concept] Where [Defined object]:[Application].([Airbus - Application Concept] = "CRUD" And Having count > 1)
- Select [Concept] Where [Defined object]:([Application].[Airbus - Application Concept] = "CRUD" And [Application] Having count > 1)
Not good: Syntax Error: invalid SELECT phrase
Could you help us?
Not sure if you could achieve this using the ERQL queries.
One workaround would be to create a macro based query where you could for example get all concepts associated to at least 2 applications. Then for each of those concepts loop through each association with an application and see if it is of type "CRUD"; if it is, increment a counter by 1; if at the end the counter for that concept is > 1, then add that concept to the query result collection. There's probably more efficient ways to code this
Hope this helps!