Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
amit_saini
Master III
Master III

Script Logic Help

Hi Folks,

I'm using below logic to when I'm having condition based on "Hour".

IF(Hour(Date) < 8, Date-1,Date)  as Date.tmp

Now what I want to do is to have condition based on "Minutes"

I need logic something like below:

IF(Minute(Date) < 08:45:00, Date-1,Date)  as Date.tmp

Please help!

Regards,

AS

1 Solution

Accepted Solutions
stabben23
Partner - Master
Partner - Master

Hi,

I have solved the same problem With this script, maybe need some modification as I use timestampfield and also the other way around. My script is: if time is bigger or Equal than 06 use date else use date-1(yesterday)

if(time(frac(timestamp(Date,'hh:mm:ss')))>=time('06:00:00'),timestamp(Date),timestamp(timestamp(Date)-1)) as %Date,

View solution in original post

4 Replies
Anil_Babu_Samineni

Either you could need to elapse time to set as hour to exist like

IF(Minute(Date) < Interval(Interval#(08:45:00,'hh:mm:ss'), 'mm'), Date-1,Date)  as Date.tmp

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
amit_saini
Master III
Master III
Author

Hi Anil,

Thanks for hint , but it's not giving me right output.

Regards,

Amit

stabben23
Partner - Master
Partner - Master

Hi,

I have solved the same problem With this script, maybe need some modification as I use timestampfield and also the other way around. My script is: if time is bigger or Equal than 06 use date else use date-1(yesterday)

if(time(frac(timestamp(Date,'hh:mm:ss')))>=time('06:00:00'),timestamp(Date),timestamp(timestamp(Date)-1)) as %Date,

amit_saini
Master III
Master III
Author

Yes this is working!

Thanks a ton