<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: ESQL String Aggregate (Thread)</title><description> Hello,  I am trying to create an ESQL query that groups  the results by the Test Case ID. For example, if I have the following table:     Test Case ID  Requirement    1  RQ1    1  RQ2    2  RQ3    2  RQ4        I want an ESQL query the groups the Requirements by Test Case ID and outputs:     Test Case ID  Requirement    1  RQ1, RQ2    2  RQ3, RQ4        For SQL, it appears that the query would be:  SELECT TEST_CASE_ID, STRING_AGG(REQUIREMENT_NAME,,) AS REQUIREMENTS  FROM SpiraTestEntities.R_RequirementTestCases  GROUP BY TEST_CASE_ID  However, ESQL removed the STRING_AGG function. Is there another way to do this? </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/spirateam/reports/2615.aspx</link><item><guid isPermaLink="false">threadId=2615</guid><author>Jacob Carbajal (jacob.d.carbajal@lmco.com)</author><title>ESQL String Aggregate</title><description> Hello,  I am trying to create an ESQL query that groups  the results by the Test Case ID. For example, if I have the following table:     Test Case ID  Requirement    1  RQ1    1  RQ2    2  RQ3    2  RQ4        I want an ESQL query the groups the Requirements by Test Case ID and outputs:     Test Case ID  Requirement    1  RQ1, RQ2    2  RQ3, RQ4        For SQL, it appears that the query would be:  SELECT TEST_CASE_ID, STRING_AGG(REQUIREMENT_NAME,,) AS REQUIREMENTS  FROM SpiraTestEntities.R_RequirementTestCases  GROUP BY TEST_CASE_ID  However, ESQL removed the STRING_AGG function. Is there another way to do this? </description><pubDate>Mon, 23 May 2022 15:47:57 -0400</pubDate><a10:updated>2024-08-20T00:07:18-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2615.aspx</link></item><item><guid isPermaLink="false">messageId=5661</guid><author>David J (adam.sandman+support@inflectra.com)</author><title> I dont think ESQL supports that Im afraid.  You may want to simply group by requirement name and th</title><description> I dont think ESQL supports that Im afraid.  You may want to simply group by requirement name and then use XSLT to do the further aggregating and grouping. </description><pubDate>Tue, 24 May 2022 15:28:40 -0400</pubDate><a10:updated>2022-05-24T15:28:40-04:00</a10:updated><link>/Support/Forum/spirateam/reports/2615.aspx#reply5661</link></item><item><guid isPermaLink="false">messageId=6604</guid><author>Erik Swedlund (erik.swedlund@ascom.com)</author><title> I am looking for a solution for exactly this.  @jacob, did you get a resolution to this issue? </title><description> I am looking for a solution for exactly this.  @jacob, did you get a resolution to this issue? </description><pubDate>Thu, 08 Feb 2024 12:31:49 -0500</pubDate><a10:updated>2024-02-08T12:31:49-05:00</a10:updated><link>/Support/Forum/spirateam/reports/2615.aspx#reply6604</link></item><item><guid isPermaLink="false">messageId=6610</guid><author>Erik Swedlund (erik.swedlund@ascom.com)</author><title> Fixed it with XSLT 1.0 as suggested.  For anyone else getting into this issue, see my code below.  </title><description> Fixed it with XSLT 1.0 as suggested.  For anyone else getting into this issue, see my code below.  XSLT ( Group Requirements by Test Case ID):    
 
         
   
   
  	 
  		 
	      
	      
	      
	      
	      
	      
		 
		 
			 # 
			 NAME 
			 REQUIREMENT 
			 STATUS 
			 VERSION 
			 BUG 
		 
    	 
     
   
   
       
           
          	 
		         
		           TC:  
		         
		         
		           TR:  
		         
			 
           
             
           
          	 
		 
			       
			         
			             
			         
			       
				 
			 
           
             
             
           
          	 
		 
			         
			             
			         
			         
			             
			         
				 
		     
           
         
   
    And heres my ESQL query to gather the info required for an TRF report (TC-&gt;REQ-&gt;BUG tracabillity)   SELECT 

   TC.TEST_CASE_ID AS ID,
   TR3.TEST_RUN_ID AS TR,
   TC.NAME,
   RQ.REQUIREMENT_NAME AS REQUIREMENT,
   TR3.EXECUTION_STATUS_NAME AS STATUS,
   TR3.RELEASE_ID,
   TR3.RELEASE_VERSION_NUMBER AS VERSION,
   I.NAME AS BUG,
   I.CUST_01 AS JIRA_LINK

FROM SpiraTestEntities.R_TestCases AS TC

   JOIN (SELECT
            TR2.TEST_CASE_ID,
            MAX(TR2.TEST_RUN_ID) AS TEST_RUN_ID,
            MAX(TR2.RELEASE_ID) AS RELEASE_ID
          FROM SpiraTestEntities.R_TestRuns AS TR2
          WHERE TR2.END_DATE IS NOT NULL
          GROUP BY TR2.TEST_CASE_ID
         ) AS TR ON TC.TEST_CASE_ID=TR.TEST_CASE_ID

   JOIN SpiraTestEntities.R_TestRuns AS TR3 ON TR3.TEST_RUN_ID=TR.TEST_RUN_ID

   LEFT JOIN SpiraTestEntities.R_RequirementTestCases AS RQ ON TC.TEST_CASE_ID = RQ.TEST_CASE_ID

   LEFT JOIN SpiraTestEntities.R_TestRunIncidents AS TRI ON TR.TEST_RUN_ID=TRI.TEST_RUN_ID

   LEFT JOIN SpiraTestEntities.R_Incidents AS I ON TRI.INCIDENT_ID=I.INCIDENT_ID


WHERE 
  TC.PROJECT_ID = ${ProjectId} AND 
  TR.RELEASE_ID IN {${ReleaseAndChildIds}}     </description><pubDate>Wed, 14 Feb 2024 09:02:14 -0500</pubDate><a10:updated>2024-02-14T09:02:14-05:00</a10:updated><link>/Support/Forum/spirateam/reports/2615.aspx#reply6610</link></item></channel></rss>