Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of time

Hello all, I have a chart like this:

TaskNameParent Task
ExecutionTImeTotalExecutionTime
Generator1-00:0500:05
Report1Generator100:1000:15 (This is the sum of time for Generator1 and Report1)
Report2-02:0002:00

How do I calculate the TotalExecutionTIme?

Thanks in advance

Message was edited by: Nemanja Momic

16 Replies
alexandros17
Partner - Champion III
Partner - Champion III

(If(isnull(taskname),0,taskname) + If(isnull(parenttask),0,parenttask))

/

(If(isnull(taskname),0,1) + If(isnull(parenttask),0,1))

let me know

avinashelite

Are this Report1Time+ Generator1Time and Repor2Time are a separate column??

From which column this Time   are coming ???

Not applicable
Author

Those are name of tasks, and Time is their execution time taken from the logs.

maleksafa
Specialist
Specialist

not very clear how you are calculating the avg however you can try the below


=rangeavg(TaskName,ParentTask)

=rangesum(TaskName,ParentTask)

avinashelite

can you please  share the sample data ? so that it will be more clear.

Not applicable
Author

Hello all, I have edited the first post in order to make it more clear.

Not applicable
Author

Not quite what I was expecting.

Could you please review the first post that I edited, for more clarified request?

Anonymous
Not applicable
Author

Hi,

Try in script as below:


LOAD TaskName,
[Parent Task],
ExecutionTIme,
if([Parent Task] = Previous(TaskName),interval(peek(ExecutionTIme)+ ExecutionTIme,'hh:mm'),ExecutionTIme) as TotalExecutionTime;
LOAD * Inline
[
TaskName,Parent Task,ExecutionTIme,TotalExecutionTime
Generator1,-,00:05,00:05
Report1,Generator1,00:10,00:15
Report2,-,02:00,02:00
]
;

Sum.png

Regards

Neetha

Not applicable
Author

Hello Neetha,

this is great, but this is just an example.

What would happen if there are multiple parent tasks?

And what would be if the parent task is not previous?

Please check the screenshoot