Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Problem with date() in a if statement

Hello,

I defined a variable vHour with the actual hour

LET vHour = date(localtime(),'hh');

and now I wanted to test if vHour is 00

if vHour = '00' then ...

but it doesnt work. I also tested this:

if vHour = date(time('00:00:00'),'hh') then ...

Pleas help me

best regards

Ingo Placzek

1 Solution

Accepted Solutions
MVP
MVP

Problem with date() in a if statement

Ingo

The Date function changes the text representation of the date value, but it returns the full date/time value (see 'dual' in the manual).

To get the time in hours, you could use text(date(localtime(),'hh')) or round(frac(localtime())*24, 1)

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
2 Replies
MVP
MVP

Problem with date() in a if statement

Ingo

The Date function changes the text representation of the date value, but it returns the full date/time value (see 'dual' in the manual).

To get the time in hours, you could use text(date(localtime(),'hh')) or round(frac(localtime())*24, 1)

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Problem with date() in a if statement

thanks, it works Smiley Wink

Community Browser