Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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
Partner - Master

Perhaps as below

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

View solution in original post

6 Replies
BrunPierre
Partner - Master
Partner - Master

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
Partner - Master

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
Partner - Master

Perhaps as below

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

Javery
Contributor II
Contributor II
Author

This works! Thanks a lot for your help 🙂