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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
aveeeeeee7en
Specialist III
Specialist III

Exclude Sunday

I have Calculated Ageing (Today() - Creation_Date). This Ageing i will use for Buckets (0-2 Days, 2-5 Days).

What i need is to exclude Number of Sundays falling between Ageing.

eg. 3/10/2013 - 21/10/2013 = 17 Days coming as per Formula but the Final Answer should be 14 since 3 Sundays falling betwwen these 2 dates.

Suggest some solution for it.

Thanks in Advance.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe similat to this:

LOAD (today()-Creation_Date) - Div(Today()-Creation_Date,7) + (weekday(Creation_Date)>weekDay(Today())) as Ageing,

  Creation_Date

INLINE [

Creation_Date

20.10.2013

13.10.2013

19.10.2013

11.10.2013

14.10.2013

03.10.2013

03.10.2013 13:15:00

];

Calculate the difference between the two dates, subtract the number of full weeks passed, and then check if remaining days passed a week border (if true, this will add -1).

View solution in original post

3 Replies
swuehl
MVP
MVP

Maybe similat to this:

LOAD (today()-Creation_Date) - Div(Today()-Creation_Date,7) + (weekday(Creation_Date)>weekDay(Today())) as Ageing,

  Creation_Date

INLINE [

Creation_Date

20.10.2013

13.10.2013

19.10.2013

11.10.2013

14.10.2013

03.10.2013

03.10.2013 13:15:00

];

Calculate the difference between the two dates, subtract the number of full weeks passed, and then check if remaining days passed a week border (if true, this will add -1).

aveeeeeee7en
Specialist III
Specialist III
Author

Thank You Sir. You are Great. Perfect.

I Really Love your Answers. Short and Simple + Powerful.

rohan_mulay
Partner - Creator
Partner - Creator