Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I have two fields "Sales" and "SalesDate" in a chart.
The Dimension is "SalesDate" and the Expression is "Sum(Sales)".
I want to put a Reference Line for the Average Sales for the Top 10 SalesDates.
Can someone please assist me with this?
Kind Regards,
Werner !
Use this expression:
=avg(aggr(
if(
rank(sum(Sales)) <= 10,
sum(Sales)
),SalesDate)
)
Use this expression:
=avg(aggr(
if(
rank(sum(Sales)) <= 10,
sum(Sales)
),SalesDate)
)
Hi Clever,
Thanks! That works perfectly.
If I wanted to take it a step further and only include the top sale days where the sales are more than 3000 sales?
Maybe this?
=avg(aggr(
if(
rank(sum(Sales)) <= 10 and sum(Sales) > 3000,
sum(Sales)
),SalesDate)
)