Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Employee
Employee

Expression Help

I have this metric in a straight table and the built in totals choice of Avg works just fine and give me the correct value at the top of the column.

DaystoApprove - Sum(PausedTime)

But what I really want to do in a KPI is not working.

I want to calculate the average of the above calculation.

Avg(DaystoApprove - Sum(PausedTime)

I get an error about nesting aggregations.  If I remove the Sum I don't get the correct result.

I have tried all kinds of things and nothing has worked so far.  Any help would be appreciated.  Thx.

3 Replies
Highlighted
MVP
MVP

What are the dimensions of the straight table where you are using the expression?

Highlighted
Creator
Creator

hi,

Try this:

Sum(PausedTime) as TotalPausedTime  // in script.

Then make KPI:

Avg(DaystoApprove -  TotalPausedTime )

Regards,

Usama

From Nothing - To Something - To Everything
Highlighted

Have you tried using Aggr() function to do this? It should be something like this

Avg(Aggr(
    DaystoApprove - Sum(PausedTime)
, <StraightTableDimensionsHere>))