0

I need help to make a metric where I need to display the average sales for the last 10 days.

I tried to do it this way, but I was not successful.

SELECT AVG(Sales WHERE (Date “in this case the day”) BETWEEN THIS - 10 AND THIS)

In short, I need to return the average sales volume of the last 10 days. Thanks

1 Answers1

1

I would substitute the "Day of Year (Data)" with simple "Date (Data)" attribute if possible. After doing so, it should work.

SELECT AVG(VLR_VENDAS_BASE_SEM_DEVOL_SEM_FRETE) WHERE (Date (Data) BETWEEN THIS - 9 AND THIS)

  • There's no "Day of Year" in the question. Also, you probably meant `Sales` instead of `VLR_VENDAS_BASE_SEM_DEVOL_SEM_FRETE`. – choroba Dec 15 '21 at 16:09