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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
CTait
Contributor
Contributor

Find Average in Bar Chart that uses Expression

I have the following measure that is used in a bar chart to show a monthly efficiency percentage:

//sum all running core resources
Sum( {< [Resource Code]={'Running / Iterations'}
, [Resource Category]={'Core'}
>}
Quantity_Adj
)
/
(( Count(Distinct Day([Previous Date Time]))
* 24 //multiply by 24, hours per day in the mongh
* Count( {<[Resource Category]={'Core'}>}
Distinct Resource
) //for core resources only
)
-
Sum( {< [Resource Code]={ 'No Samples / Support Parts'
, 'No Project'
, 'Holiday'
, 'Calibration Parts / Project'
, 'No Power'
, 'Development'
, 'Maintenance Parts / Project'
} //subtract all codes that are out of our control
, [Resource Category]={'Core'} //for core resources only
>}
Quantity_Adj
))

I need to display the YTD average of this expression output, but it will not work because of this part of the expression:

(( Count(Distinct Day([Previous Date Time]))
* 24 //multiply by 24, hours per day in the month
* Count( {<[Resource Category]={'Core'}>}
Distinct Resource
) //for core resources only
)

How can I calculate the average?

0 Replies