Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Average last three days except Sunday

Hi because of your help in my last discussion I set the following expression in order to get the average of sales in the last 3 three days given a particular date vDateRotura

sum({<CalendarDate={">=$(=max(date(vDateRotura-3)))<=$(=max(date(vDateRotura-1)))"}> }  VENTAS.Peso)

/Count(DISTINCT {<CalendarDate={">=$(=max(date(vDateRotura-3)))<=$(=max(date(vDateRotura-1)))"}> }  CalendarDate)

Now what I would like to achive is the same expression but excluding the sundays. E.g. If the given date falls on Thrusday I want the average of previous Friday+Saturday+Monday.

Any ideas?

Thanks in advance

Labels (1)
4 Replies
rakesh_kumar
Creator
Creator

Hi add this in the set analysis:

weekday(vDateRotura)={*}-{7}

Anonymous
Not applicable
Author

Sorry Rakesh, I don't know exactly how to do it. Could you please lead me?

Thank you

rakesh_kumar
Creator
Creator

Hi,

Due to restrictions on the system I am replying this thread I am unable to copy and paste your whole expression here, but it will will be something like this:

Sum({<CalendarDate={" ..."}, weekday(vDateRotura) = {*}-{7}>} ventas.peso)

/ Count(Disctinct {<CalendarDate={"..."}, weekday(vDateRotura)={*}-{7}>} CalendarDate)

Anonymous
Not applicable
Author

It doesn't work. Maybe I'm doing something wrong. I didn't say that vDateRotura is a variable. Thank you anyway.