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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
CTait
Contributor
Contributor

Calculate Average on Bar Chart using Expression

Hello, I have a measure that uses the expression below to calculate a monthly efficiency percentage. I am trying to find a way to calculate the YTD average in a KPI based on the expression but I cannot get anything to work. Suggestions?

Sum( {< [Resource Code]={'Running / Iterations'}
, [Resource Category]={'Core'}
>}
Quantity_Adj
)
/
(( Count(Distinct Day([Previous Date Time]))
* 24 
* Count( {<[Resource Category]={'Core'}>}
Distinct Resource

)
-
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'} 
>}
Quantity_Adj
))

Labels (1)
2 Replies
vinieme12
Champion III
Champion III

you might want to check your bracketing, syntax wise there are no problems

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
CTait
Contributor
Contributor
Author

Hi Vineeth,

I know the expression works.  I am currently using it in a bar chart. What I am trying to do with it is find a way to pull a YTD average from it. I cannot find a way to put the average in the bar chart. My Qlik version does not have the average line option so I was either trying to add a bar for the average or have the average in a KPI. I cannot find a way to use the expression to calculate the average.