# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

#### Breathe easy -- you now have more time to plan your next steps with Qlik! QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Honored Contributor 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

Regards,

AS

1 Solution

Accepted Solutions
Honored Contributor

## Re: Script Logic Help

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,

4 Replies
MVP

## Re: Script Logic Help

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

Life is so rich, and we need to respect to the life !!!
Honored Contributor III

## Re: Script Logic Help

Hi Anil,

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

Regards,

Amit

Honored Contributor

## Re: Script Logic Help

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,

Honored Contributor III

## Re: Script Logic Help

Yes this is working!

Thanks a ton

Community Browser