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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Add a group average in a line graph

I created a graph to view sales by store by month for a set of years. I want to add a calculated line that would have the group average so that when I select a specific branch, the graph shows the sales for that one store and has a group average visible as well so that I can compare the store to the group.

3 Replies
Not applicable
Author

You can add in presentation --> reference line -> you can create a expression with IF

To get what is select you can use getcurrentfield( )

Not applicable
Author

What is your Sales expression? The average will depend on that and then you probably need to ignore certain dimensions and selections when a specific branch is selected.

You probably also need to use Aggr() to get the average if the sales expression is an aggregate. Something like:

Avg({<Branch=>}Aggr(Sum({<Branch=>} TOTAL Sales), Branch)


Some of that will depend on your data.

Not applicable
Author

Thanks N (ninja?) That gets me to have a total for the branches for one month only and not over time, but definitely a step in the right direction.