Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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
MVP
MVP

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

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