Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
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: 
shri
Contributor II
Contributor II

How to exclude only Sunday from dates?

hi everyone.

My question is  : How to exclude only sunday from dates?

i have 1 common date field named [ship date]

i want to subtract this by 2 that means [Ship date - 2(days)]

eg: if ship date= 28-09-2018 then according to this formula [Ship date - 2(days)]=26-09-2018 >>[ date1]

so assume the date we got after subtracting, is [date 1]

If my date field [date1] is sunday then i want to display date using same formula with [Ship date - 3(days)] but

if my date field [date1] is working day (from monday to  saturday) then i want to display date as [Ship date - 2(days)]


3 Replies
dplr-rn
Partner - Master III
Partner - Master III

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

How about:

Date(if(WeekDay(ShipDate)='Tue', ShipDate-3, ShipDate-2)) as [date 1]

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com

shri
Contributor II
Contributor II
Author

I used the below formula which calculates the data perfectly for me :

if(weekday([date 1])=WeekDay(1),date([Ship date]-3),date([Ship date]-2))