# QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

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
Contributor II

## Re: Calculate Averages in set analysis

Hi Moses,

you can try

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

12 Replies
MVP

## Re: Calculate Averages in set analysis

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

and

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

Not applicable

## Re: Calculate Averages in set analysis

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

MVP

## Re: Calculate Averages in set analysis

You can try something like:

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

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

MVP

## Re: Calculate Averages in set analysis

May be something like this:

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

MVP

## Re: Calculate Averages in set analysis

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

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

Not applicable

## Re: Calculate Averages in set analysis

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

MVP

## Re: Calculate Averages in set analysis

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

MVP

## Re: Calculate Averages in set analysis

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

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

Not applicable

## Re: Calculate Averages in set analysis

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