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: 
MRitter
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
Kushal_Chawda

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

Usama
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
sunny_talwar

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

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