Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Average of the last three mondays

Hi everyone, does anybody know if there's a way to set the sum analisys of the las 3 mondays( of any other weekday) given a date.

Lets say I have the following tableCaptura.PNG

I need a result table like the one in the rigth side.

Thanks in advance

1 Solution

Accepted Solutions
ramoncova06
Specialist III
Specialist III

sum({

<CalendarDate = {">=$(=DATE(FLOOR(WEEKSTART(MAX(CalendarDate),-2))))"}>

*

<CalendarDate = {"=WeekDay(CalendarDate)=0"} >

}SalesAmount)

** changed to sum instead of avg

View solution in original post

4 Replies
maxgro
MVP
MVP

Sum({<Calendate={"<=$(=Today())>=$(=date(Today()-20))"}>} if(WeekDay(Calendate)='mon', Amount))

ramoncova06
Specialist III
Specialist III

sum({

<CalendarDate = {">=$(=DATE(FLOOR(WEEKSTART(MAX(CalendarDate),-2))))"}>

*

<CalendarDate = {"=WeekDay(CalendarDate)=0"} >

}SalesAmount)

** changed to sum instead of avg

Anonymous
Not applicable
Author

Thank you both of you. The two ways are correct!! At least to me.

ramoncova06
Specialist III
Specialist III

Glad it worked ... that one of the things with QV you can have several ways for getting the same results