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 with conditional

Hello,

i need sum some rows

example

DATENAMEKIND OF ACTIVITYSTAR ACTIVITYSTATUSEQUIP NAMETOTAL TIME
31-8-12HELMANM.P22:00OKBTA 105:00 Hours
31-8-12HELMANM.P23:00OKBTA102:00 hours
1-9-12WILMAREMERGENCY08:00PENDINGBTA201:00 hours
1-9-12LEOANRDOTEST07:00PENDINGBTA205:00 hour

I need sum the rows  Total Time that have the same information as one row.

i have this  comand line

 

  =Count({$<Status={"OK"}>}Distinct [Kind of Activity]&[Fecha]&[Equipment Name])

but, this line only count.

i need use  the same conditional,  but i need sum the total time.

example,

 

sum

([Total Time])

but, i need use the conditional  ({$<Status={"OK"}>}Distinct [Kind of Activity]&[DATE]&[Equipment Name])

thank you

2 Replies
nagaiank
Specialist III
Specialist III

You may try the following:

Aggr(Sum({$<Status={"OK"}>}[Total Time]),[KIND OF ACTIVITY]&[DATE]&[EQUIP NAME])


whiteline
Master II
Master II

In case your [Total Time] has numeric representation you can try the following:

=Sum(Aggr(Only({$<Status={"OK"}>} [Total Time]), [Kind of Activity]&[Fecha]&[Equipment Name]))

In case it's just string you also need to transform it (use instead [Total Time] in the above):

TimeStamp#(Subfield([Total Time], ' ', 1), 'hh:mm')