Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Moving Data over Time period.

Hi guys, I have a problem which I am really strugling to even start, so I have a ticketing system database which I already have all the data for it, now I have a requirement for a Line Chart that shows me the Non-Closed and Not on Hold ticket count for the last 48 hours, this will obviously be reloaded frequently on the server and keep updating the line graph, the fields I have are the following.

Ticket
ChangeDate
Status
Change
12309/09/2014 12:00OpenTicket Open
12309/09/2014 14:00OpenChange1
12310/09/2014 11:00ClosedClosed
45609/09/2014 12:00OpenTicket Open
45609/09/2014 17:00On HoldChange1
45609/09/2014 17:20OpenChange2
78903/09/2014 09:23OpenTicket Open
78904/09/2014 12:00OpenChange1
78909/09/2014 13:00OpenChange2
78909/09/2014 13:10OpenChange3
45709/09/2014 11:10OpenTicket Open
45709/09/2014 15:15OpenChange1
45709/09/2014 17:50OpenChange2
45709/09/2014 22:03OpenChange3

Now Obviously, this data might change, for example in 5 minutes Ticket Number 457 might get closed.

Any help will be greatly appreciated.

6 Replies
JonnyPoole
Former Employee
Former Employee

Hi.

Here is an attempted solution that uses a Time table that dynamically calculates 48 records denoting the last 48 hours in 1 hour increments and then uses an intervalmatch to figure out which tickets were open during each of the previous 48 hours

Capture.PNG.png]

The load script is:

Tickets:

LOAD Ticket,

     ChangeDate,

     now() as CurrentDate,

     Status,

     Change

FROM

(ooxml, embedded labels, table is Sheet1);

Last48Hours:

load

  timestamp(now() - interval(Interval#( RecNo()-1 & ':' & '00', 'hh:mm'))) as Time

AutoGenerate 49;

Intervals:

IntervalMatch (Time) LOAD ChangeDate, CurrentDate Resident Tickets;

Not applicable
Author

Hi, thanks for your help, but it seems this solution keeps on adding results, I added some data to the table from 2010, 2011 etc and these show up in the graph.

On my real data im starting with 20.000 Tickets, If you build a Table with the results from your script the Dimension "Time" fill the whole table for all years and all times with a Date from the previous 48 hours.

Not applicable
Author

It also seems never to deduct numbers, they keep getting added, and the line never drops so for the following Data.

TicketChangeDateStatusChange
109/09/2014 09:03OpenTicket Open
109/09/2014 10:05OpenChange
209/09/2014 09:10OpenTicket Open
209/09/2014 10:10ClosedClosed
309/09/2014 11:20OpenTicket Open
409/09/2014 11:20OpenTicket Open
509/09/2014 11:25OpenTicket Open
609/09/2014 11:29OpenTicket Open
309/09/2014 14:20ClosedClosed
409/09/2014 14:20ClosedClosed
509/09/2014 14:25ClosedClosed
609/09/2014 14:29ClosedClosed

From 9:00 to 10:00 the count should be 2. Ticket 1 and 2 are open.

From 10:00 to 11:00 the count should be 1. As Ticket number 1 is still open but ticket number 2 was closed.

From 11:00 to 12:00 the count should be 5. Ticket 1 is still open and tickets 3,4,5,6 were created.

From 12:00 to 13:00 5.

From 13:00 to 14:00 5.

From 14:00 to 15:00 1. Tickets 3,4,5,6 were closed but Ticket 1 is still open.

Many Thanks

JonnyPoole
Former Employee
Former Employee

Correct. The sequential nature what not taken into account. I'll take another look soon

JonnyPoole
Former Employee
Former Employee

Okay. Here is another attempt.

In the load i am switching the structure into a list of ' Ticket Statuses'  with starts and end dates.  This is different than the format in the data source which is a list of 'Ticket status changes' with change dates.

I believe this sets the data up well for an intervalmatch on a dynamic 48 hour calendar table (for the last 48 hours).

Couple things:

- I'm not sure about your date format in the real data source so there may need to be some formatting in the qlik script to adapt

- the 48 hour calendar goes down to the second. you can cycle from date to hour to minute to actual time

- the chart will work for all status types, not just open. Just select open to see the chart you were looking for to show only open cases.

Capture.PNG.png

Not applicable
Author

Hi Jonatham thank you very much for all the time you have lost with my problem.

I will test it at work tomorrow, and get some feedback.

Once again many thanks.