Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate Averages in set analysis

Good morning,

I am trying to calculate averages for the attached file. The formula I have used to calculate

Total_PreviewTime=Sum ({<PreviewedFirst={1}>}PreviewTime) and I want to calculate the Average Total_PreviewTime  and similarly for

Total_CallTime=sum(CallTime) I want to calculate Average Total_CallTime

PFA,

Thanks

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi Moses,

you can try

Aggr(Sum ({<PreviewedFirst={1}>}PreviewTime),Dim1,Dim2,Dim3) / Count ({<PreviewedFirst={1}>}PreviewTime)

View solution in original post

12 Replies
MK_QSL
MVP
MVP

What about

Avg({<PreviewedFirst={1}>}PreviewTime)

and

Avg({<Total_CallTime={1}>}Total_CallTime)

Not applicable
Author

Hi Manish,

I am actually looking for the Average of Sum ({<PreviewedFirst={1}>}PreviewTime), if there is something like

avg(Sum ({<PreviewedFirst={1}>}PreviewTime)). Not sure if this is possible


Thanks

tresesco
MVP
MVP

You can try something like:

avg(Aggr(Sum ({<PreviewedFirst={1}>}PreviewTime), Dim1))


Where Dim1 is dimension(s) on which the aggregation is desired.

sunny_talwar

May be something like this:

Avg(Aggr(Sum({<PreviewedFirst={1}>}PreviewTime), CallCentre, Desk, Team_Lead, Agent_Name, Day))

MK_QSL
MVP
MVP

You need to use Aggr as per Tresesco;s reply..

Avg(Aggr(SUM(YourExpression),Dim1,Dim2,Dim3))

Not applicable
Author

Thank you for the all the responses, when I use this  =Avg(aggr(Sum ({<PreviewedFirst={1}>}PreviewTime),Day)) and I use Interval format (hh:mm:ss) and my graph comes like

Capture.PNG

sunny_talwar

So this is not what you are looking to do? What is your expected output here?

tresesco
MVP
MVP

You probably need same average across days, if so try like:

=Avg(Total aggr(Sum ({<PreviewedFirst={1}>}PreviewTime),Day))

Not applicable
Author

Hi Sunny T,

The formula is fine but now when I put on the line graph, the I select the format of Interval hh:mm:ss is not translating correctly. I am expecting the time intervals of 00:00:00 to 00:30:00

thanks