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: 
Javery
Contributor II
Contributor II

Ignore some values in Average KPI calculator

Hello,

I've created a calculated field to see the time between two dates, which I then need to calculate the average time. I want to ignore some values depending on another field (category). Imagine I want to exclude everything from Category B from the average time between calculation.

See attached image.

Grateful for any help 🙂

Thanks

 

Labels (3)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master II
Partner - Master II

Perhaps as below

Avg({$<Category*={'A'}>}TimeBetween)

View solution in original post

6 Replies
BrunPierre
Partner - Master II
Partner - Master II

I assume you want to exclude the "B" rows, if so, like below.

Avg({$<Category=E({1<Category={'B'}>})>}TimeBetween)

Javery
Contributor II
Contributor II
Author

I don't think this is giving me the correct result unfortunately, I have a second chart which shows the categories (See attached) which when clicking on the categories doesn't seem to change.

BrunPierre
Partner - Master II
Partner - Master II

Can you please clarify your issue as I can assure you that the the expression disregards the "B" values.

Javery
Contributor II
Contributor II
Author

Sure, F.Y.I this is probably my mistake as I'm very new to this.

We have multiple categories (as expressed A in the example, then category 'B' which is what I need to exclude).

I have a pie chart (as above) which shows all of the categories. Each category definitely has a different 'TimeBetween' average but when clicking to filter per category it's staying the same value regardless.

Does that make sense?

BrunPierre
Partner - Master II
Partner - Master II

Perhaps as below

Avg({$<Category*={'A'}>}TimeBetween)

Javery
Contributor II
Contributor II
Author

This works! Thanks a lot for your help 🙂