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

Need to calculate the Avg of another calculation

I am running into a problem with my expression.

This is ultimately what I want:  I am trying to subtract any paused time from the total time and then get an average for the dimension type.

Avg(Interval(rejejctedtimestamp - submittedtimestamp,'hh')) - Sum(PausedTime))

It will not allow me to nest the functions. I can remove the Sum from PausedTime and I don't get the error.  But it doesn't work correctly.

Not sure what my options are here?

3 Replies
Highlighted

May be this

Avg(Aggr(
  RangeSum(
    rejejctedtimestamp,
    -submittedtimestamp,
    -Sum(PausedTime)
  )
, Dimension/s))

Replace Dimension/s with list of dimension/s where you are Sum(PausedTime) on.

Highlighted
Employee
Employee

Thanks Sunny

I am actually using a ValueList for the Dimension.

When the value is Paused Time I want to do this calculation.  When the value is No Paused Time then this is not an issue.

Can that be done with your logic?

Highlighted

I am not sure I follow... do you have a sample you can share to show this?