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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Sylvain77
Contributor
Contributor

How to calculate an average on calculated field excluding outliers

Hi,

I've been facing the following issue, and could not find any solution on this forum. Here is the problem.

In the line chart below, the blue line represents the return on assets (RoA) of a company, and the red line the average of the return of assets for the whole group (ignore the filter on company_name : {<company_name=>}

 

 

Now, the big drop in 2018 on the red line is because 1 company has a RoA way below the average, as you can see on the distribution below

Distribution.PNG

 

I have 2 variables (vMax and vMin) which helps identify the outliers, i.e. if you are above vMax or below vMin then you are considered outlier. 

What I want to do is to display in that line chart the average of RoA calculated over all companies except if their RoA is outside the acceptable range [vMin - vMax].

I think I would be able to do it if the RoA was a field from my tables as I could put the condition in the  set expression. However the RoA is calculated as net_income / total_assets (net_income and total_assets are fields in my tables)and so I don't know how to write the set expression

Any help would be really appreciated

Thank you

Labels (2)
1 Reply
Sylvain77
Contributor
Contributor
Author

For some reason the line chart didn't make it into my post. Here it is

 

line chart.PNG