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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple average calculation - Showing as a guage

I have travel expenses by type of travel expense. Albeit  airfare, meals, rental...etc. I want the average priced paid for airfare. I need to know how to only select type equal to airfare and then perform the math of total Airfare / count of airfare type. I like to show it in a guage chart.

5 Replies
tobias_klett
Partner - Creator II
Partner - Creator II

Hi,

try using set analysis like this for airfare:

sum( {<Type={airfare}>} price) / count( {<Type={airfare}>} price)

Hope this helps

Tobias

maxgro
MVP
MVP

gauge only needs an expression, so maybe (replace with name of your fields and upper/lowercase)

avg ({$ <type={airfare}>} expenses)

Not applicable
Author

sum({<[Expense Type]={Airfare (Employee Ticket Only)}>}[Travel Expense])/count({<[Expense Type]={Airfare (Employee Ticket Only)}>})

Current expression won't work

tobias_klett
Partner - Creator II
Partner - Creator II

Hi,

use:

sum({<[Expense Type]={'Airfare (Employee Ticket Only)'}>} [Travel Expense] )/count({<[Expense Type]={'Airfare (Employee Ticket Only)'}>}[Travel Expense])

Tobias

Not applicable
Author

This worked but in the gauge chart I can’t get the avg price to appear and how do I get the minimum vale and maximum value to appear?