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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
mhmmd_srf
Creator II
Creator II

To Find Next Monday for Week End

Hi All,

I have a field called StartTime, which is MM/DD/YYYY hh:mm:ss format.

I want to write a logic like below:

if my StartTime is falling under Satday or Sunday, then it will show Next Monday 08:00:00, else StartTime.

Could anyone please help me how to put this in Qlikview Script.

Thanks,

Sarif

1 Solution

Accepted Solutions
tresesco
MVP
MVP

May be this?

If( Match(WeekDay(StartTime), 'Sat', 'Sun'), TimeStamp(WeekStart(StartTime,1,0)+8/24), TimeStart)

Note: Assuming your field is a real timestamp field and not a string field. Otherwise, you have to convert the string using parsing function like date#()/timestamp#().

View solution in original post

1 Reply
tresesco
MVP
MVP

May be this?

If( Match(WeekDay(StartTime), 'Sat', 'Sun'), TimeStamp(WeekStart(StartTime,1,0)+8/24), TimeStart)

Note: Assuming your field is a real timestamp field and not a string field. Otherwise, you have to convert the string using parsing function like date#()/timestamp#().