Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
makrishnaraj
Contributor III
Contributor III

Average for a week based on selected date

Hi,

I need to calculate the Average for the 5 days say for example in the below table. If i select Report Date as 25/09/2015 then my average should display as  11.4 in the text box i.e. avg of 21/09/2015 to 25/09/2015.

 

IDReportDateSum(CallsAnswered)
1065821/09/20158
1065822/09/20159
1065823/09/201514
1065824/09/201514
1065825/09/201512

Thanks in advance.

Regards,

Krishna

1 Solution

Accepted Solutions
makrishnaraj
Contributor III
Contributor III
Author

Hi Balraj,

Thanks for you help.

I used the below formula & it worked for me.

=(Sum({<ReportDate={">=$(=date(max(ReportDate)-5))<=$(=date(max(ReportDate)))"}>} CallsAnswered))/5

View solution in original post

6 Replies
Anonymous
Not applicable

you can try sth like:

=avg({<ReportDate={'>=$(=date(max(YourDateField)-5,'DD/MM/YYYY')

<=$(=date(max(YourDateField),'DD/MM/YYYY')>} CallAnswered)

Hope this will help!!

makrishnaraj
Contributor III
Contributor III
Author

Hi Balraj,

Thanks for you Information, as you have mentioned max(YourDateField),  the DateField is also a ReportDate.

Anonymous
Not applicable

okay, simply try:

=avg({<ReportDate={'>=$(=date(max(ReportDate)-5,'DD/MM/YYYY')

<=$(=date(max(ReportDate),'DD/MM/YYYY')>} CallAnswered)

Not applicable

Hi,

try this:

makrishnaraj
Contributor III
Contributor III
Author

Hi Balraj,

Thanks for you help.

I used the below formula & it worked for me.

=(Sum({<ReportDate={">=$(=date(max(ReportDate)-5))<=$(=date(max(ReportDate)))"}>} CallsAnswered))/5

HirisH_V7
Master
Master

Hi,

Check out the attachment .

I hope that helps.

Regards,

Hirish7days.PNG

HirisH
“Aspire to Inspire before we Expire!”