How to keep average line after filtering

Hi All!
I’m interested in creating a line chart for comparing the performance of different agents against the average performance. see example data:
Screen Shot 2022-10-09 at 10.33.47

My X-axis is time and my Y-axis is the agensts’ monthly average of sales.
I would like to be able to filter to one agent (in real life I have dozens of them) and see their performance compared to average performance of all agents over time.
I’ve tried the combo plot; but when filtering to less agents, the average (the line chart) is also filtered accordingly.
any help would be most appreciated!

You can do an avgOver and set the calculation level to be PRE_FILTER!

I’m using countOver for ease of displaying purposes but you would use avgOver

countOverFilter = countOver({session_id},[truncDate(‘DD’,{arrival_timestamp})],PRE_FILTER)

your calculation = avgOver({sales},[date],PRE_FILTER)

Here is the graph without filtering. As you can see the line matches the bars. This means that it is taking the countOver all of the client_ids in my example. Also notice the numbers are in the hundres.

Next I will filter to one client.

As you can see the bars have changed. On the left axis is the count for just that one client. However, on the right axis the numbers are the same as the previous graph and so is the line!

Something to note is that this will only display for dates that are part of that one client.

Let me know if that helps!

1 Like