How to add previous row to the next row

Wednesday, April 30, 2025
Avatar

Hi everyone,

I'm working on a project in SpiraTest and need some help with ESQL. Specifically, I want to:

  1. Include the previous data in the next row to be added. 

Actual Result: 

Execution Date for Test SetPassed Test Case 
15/04/20253
16/04/20251

 

Preffered Result: 

Execution Date for Test SetPassed Test Case 
15/04/20253
16/04/2025

 

          2. Add a new column that is based on the Planned_date field, incremented by 5 days for a specified number of times.

Has anyone done something similar or can provide guidance on how to achieve this? Any examples or tips would be greatly appreciated!

Thanks in advance!

4 Replies
Wednesday, April 30, 2025
Avatar
re: Larsnjewel Wednesday, April 30, 2025

Hello,

Can you please share the actual query that calculates the number of passed tests?

 

Regards,
Victoria -

Wednesday, April 30, 2025
Avatar
re: inflectra.Victoria Wednesday, April 30, 2025

Hi this is my created SQL with the Total Passed and Total Executed TC's 

SELECT 
  Combined_Date,
    SUM(CASE WHEN TC.EXECUTION_STATUS_NAME = 'Passed' THEN 1 ELSE 0 END) AS Total_Passed,
    SUM(CASE WHEN TC.EXECUTION_STATUS_NAME = 'Passed' THEN 1 ELSE 0 END) + 
    SUM(CASE WHEN TC.EXECUTION_STATUS_NAME = 'Failed' THEN 1 ELSE 0 END) AS Total_Executed
FROM 
    SpiraTestEntities.R_TestRuns AS TR
INNER JOIN 
    SpiraTestEntities.R_TestCases AS TC 
    ON TR.END_DATE = TC.EXECUTION_DATE
WHERE 
    TR.PROJECT_ID = ${ProjectId}
GROUP BY 
    TruncateTime(TR.END_DATE) AS Combined_Date
 

Thursday, May 15, 2025
Avatar
re: Larsnjewel Wednesday, April 30, 2025

Hi,

To add the value of the previous row to the current row (cumulative total), you can use the function to calculate the total running in order of execution date. As for creating an additional date column increasing by Planned_date every 5 days, you just need to repeat the operation of adding 5 days for each record.

Monkey Mart

Friday, May 16, 2025
Avatar
re: sophia2005 Wednesday, May 14, 2025

You can use the function to determine the total running in order of execution date by adding the value of the previous row to the current row (cumulative total). 

 

Sprunki Incredibox

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Wednesday, April 30, 2025
  • Last Reply: Friday, May 16, 2025
  • Replies: 4
  • Views: 148