If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.
Hello
Need help calculating average age using this expression:
Average(Age (service_date, entry date) where
Service Name = "Service" and Entry Provider = "Provider1"
Is age the difference between service_date and entry_date?
Try creating a Age field in your load script (something like (service_date - entry_date) AS Age
Then use the Age field in your average:
Avg({$<ServiceName={'Service'}, EntryProvider={'Provider1'}>} Age)
the age function only returns years.
As William said, you could put the difference as a new field, but you can also just do it in an expression:
Avg({$<ServiceName={'Service'}, EntryProvider={'Provider1'}>} service_date - entry_date)
If you are looking to group the average by Service and Provider, then you'd need to use Aggr()
Avg(Aggr(Avg(service_date - entry_date),ServiceName,EntryProvider))