We help IT Professionals succeed at work.
Get Started

Tracking and counting records as they move through statuses per day

338 Views
Last Modified: 2012-08-21
Hello,

     I need some help creating a report in SSRS that has a running total of records as they change status at the end of each day for a date range.  I am able to create reports with running totals by day if the data is incremental, but i experience an issue when a record changes status (i.e. from In progress to Failed and back to in progress) how do I subtract from the first running total and add to the second. I have 10 status I need to create this report from and there isn't a current logic of if in status A it came from status C.  Is there a way to create a variable per status to check against that stores?  This has been driving me up the wall!

Here is the query to get the data that I need a running total from:

select  convert(date,dateEvent) as date,
(case when a.rsltstate in (28) then idrecord end) as OnHold,
(case when a.rsltstate in (57) then idrecord end) as Blocked,
(case when a.rsltstate in (23) then idrecord end) as NotStarted,
(case when a.rsltstate in (24) then idrecord end) as InProgress,
(case when a.rsltstate in (25) then idrecord end) as Passed,
(case when a.rsltstate in (26) then idrecord end) as Failed,
(case when a.rsltstate in (27) then idrecord end) as UnClear,
(case when a.rsltstate in (29) then idrecord end) as ReRun,
(case when a.rsltstate in (52) then idrecord end) as InvaildTest,
(case when a.rsltstate in (58) then idrecord end) as ConditionalPass

from trevts a where
OrderNum = (select MAX(ordernum) from TREVTS b
where CONVERT(date,dateadd(hh, -7,b.dateevent)) = CONVERT(date,dateadd(hh, -7,a.dateevent)) and RsltState !=0)
and a.parentid in (select idrecord from TESTRUN )

here is the data of the individual parentids per day:  

Data from Query showing parentid per day in each status
Here is the chart I am trying to produce with a running count of records per day
running total chart of parent ids per day




Thanks!

Chris
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE