Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculating averages over a month

Hi All,

Quick question involving an average percentage calculated both as a whole and over a month.

  • Scenario 1: No month selected - Average over the entire month.
  • Scenario 2: Month selected - Utilisation for that month

I've tried two expressions to calculate the averages, but neither works for both scenarios.

'Utilisation Overall' Expression is

Sum([Billed Hours])/sum([Location Available  Hours])

'Utilisation MBM' Expression is

Sum([Billed Hours]/[Location Available  Hours])

Scenario 1: No month selected.

Unselected.png

Overall expression works fine but MBM does not.

Scenario 2: Month selected.

Selected.png

MBM expression works fine but overall does not.

Is it possible to use a single expression which works for both scenarios?

Many Thanks,

Joe

3 Replies
sunny_talwar

How about like this:

If(GetSelectedCount(Month) >0, Sum([Billed Hours]/[Location Available  Hours]), Sum([Billed Hours])/sum([Location Available  Hours]))

Not applicable
Author

Exactly what I was looking for - It's been a long day...!

Thanks very much

Joe

sunny_talwar

No problem at all