Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a field call Start Time as MM/DD/YYYY hh:mm:ss. I want a logic if the time is > 17:00:00, then it will return next day 10:00:00.
Like if the values is 25-06-2018 22:09:00, then it should show 26-06-2018 10:00:00.
Can you please help me to do this in script.
Thanks,
Sarif
Sorry, just realized that your date format is different then what it comes in as... may be if you Start Time is not read properly, you might need TimeStamp#() function to help Qlik understand your timestamp field
TimeStamp(If(Hour(TimeStamp#([Start Time], 'MM/DD/YYYY hh:mm:ss')) > 17, Floor(TimeStamp#([Start Time], 'MM/DD/YYYY hh:mm:ss')) + 1 + MakeTime(10), TimeStamp#([Start Time], 'MM/DD/YYYY hh:mm:ss')), 'DD-MM-YYYY hh:mm:ss') as [Start Time]
May be this
TimeStamp(If(Hour([Start Time]) > 17, Floor([Start Time]) + 1 + MakeTime(10), [Start Time])) as [Start Time]
Or you can specify the format with TimeStamp
TimeStamp(If(Hour([Start Time]) > 17, Floor([Start Time]) + 1 + MakeTime(10), [Start Time]), 'DD-MM-YYYY hh:mm:ss') as [Start Time]
Sorry, just realized that your date format is different then what it comes in as... may be if you Start Time is not read properly, you might need TimeStamp#() function to help Qlik understand your timestamp field
TimeStamp(If(Hour(TimeStamp#([Start Time], 'MM/DD/YYYY hh:mm:ss')) > 17, Floor(TimeStamp#([Start Time], 'MM/DD/YYYY hh:mm:ss')) + 1 + MakeTime(10), TimeStamp#([Start Time], 'MM/DD/YYYY hh:mm:ss')), 'DD-MM-YYYY hh:mm:ss') as [Start Time]
Thank Sunny...I did in below way and it is working..
Date(Timestamp(DayStart((Date([Start Time]+1)))+10/24),'MM/DD/YYYY hh:mm:ss')