# AQL issue with Same cluster used in multiple archetypes in the same template in version 2.0 **Category:** [AQL](https://discourse.openehr.org/c/aql/43) **Created:** 2025-05-06 05:45 UTC **Views:** 115 **Replies:** 5 **URL:** https://discourse.openehr.org/t/aql-issue-with-same-cluster-used-in-multiple-archetypes-in-the-same-template-in-version-2-0/6763 --- ## Post #1 by @Sravanthi_Kovi [sample_template.en.v0.t.json|attachment](upload://jDhpJDVVvF4spcfpCFcFtdXB5QM.json) (190.3 KB) AQL : { "q": " SELECT c1/items[at0031]/value/value as staging, c1/items[at0003]/value/value as T, c1/items[at0004]/value/value as M, c1/items[at0005]/value/value as N FROM EHR e CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1] CONTAINS CLUSTER c1[openEHR-EHR-CLUSTER.tnm.v1] where c/uid/value ='cuid'" } --- ## Post #2 by @linforest Formatting may be easier for others to understand: ```aql SELECT c1/items[at0031]/value/value as staging, c1/items[at0003]/value/value as T, c1/items[at0004]/value/value as M, c1/items[at0005]/value/value as N FROM EHR e CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1] CONTAINS CLUSTER c1[openEHR-EHR-CLUSTER.tnm.v1] where c/uid/value ='cuid'" ``` Note: The formatting above is just my example and is not necessarily prescriptive. --- ## Post #3 by @siljelb You don't mention what the issue is? For example an error message? --- ## Post #4 by @Sravanthi_Kovi we are getting the aql response as null. --- ## Post #5 by @birger.haarbrandt Hi @Sravanthi_Kovi, it would be great if you raise the issue in GitHub: https://github.com/ehrbase/ehrbase/issues --- ## Post #6 by @Sravanthi_Kovi Hi @birger.haarbrandt sure will do that, thank you --- **Canonical:** https://discourse.openehr.org/t/aql-issue-with-same-cluster-used-in-multiple-archetypes-in-the-same-template-in-version-2-0/6763 **Original content:** https://discourse.openehr.org/t/aql-issue-with-same-cluster-used-in-multiple-archetypes-in-the-same-template-in-version-2-0/6763