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

CALCULATED FIELD CREATION INTO QVD LOAD - WHAT'S WRONG IN THIS SYNTAX?

LOAD 

...

...

ScheduledDateTime

IF (time(time#(ScheduledDateTime, 'dd/mm/yyyy hh:mm'), 'hh:mm') < '10:00', '1st wave', 'Normal') AS "First Wave",

...

...

FROM xyz.qvd

what's wrong with the syntax above? why can't I display the First Wave field?

thanx


6 Replies
tresesco
MVP
MVP

Better not to use formatting functions for comparison, I would rather try like:

IF (hour(time#(ScheduledDateTime, 'dd/MM/yyyy hh:mm')) < 10, '1st wave', 'Normal') AS "First Wave

Also note:

mm -> minute

MM -> Month

alexandros17
Partner - Champion III
Partner - Champion III

LOAD

...

...

ScheduledDateTime <- If it is a field then use a comma at the end: ScheduledDateTime ,

IF (time(time#(ScheduledDateTime, 'dd/mm/yyyy hh:mm'), 'hh:mm') < '10:00', '1st wave', 'Normal') AS "First Wave", <- Write the aliasinthis way: First_Wave without "

...

...

FROM xyz.qvd


Let me know

Not applicable
Author

Hi,

you can use the below.

=IF (num(time(time#('10/16/2014 8:05', 'dd/mm/yyyy hh:mm'), 'hh') )<num(Time#('10','hh')), '1st wave', 'Normal')

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi Fra,

please make sure comma placing between two line.

in your line no comma between two line.

try this script

ScheduledDateTime ,

IF (time(time#(ScheduledDateTime, 'dd/mm/yyyy hh:mm'), 'hh:mm') < '10:00', '1st wave', 'Normal') AS "First Wave",

alex_nerush
Partner - Creator II
Partner - Creator II

i've tested your expressions 

load

IF (time(time#('16.10.2014 9:00', 'DD.MM.YYYY hh:mm'), 'hh:mm') < '10:00', '1st wave', 'Normal') AS "First Wave"

autogenerate 1;

works fine.

Maybe you have specified wrong format 'dd/mm/yyyy hh:mm' for ScheduledDateTime field?

Anonymous
Not applicable
Author

tried this but nothing:

IF (hour(time#(ScheduledDateTime, 'DD/MM/YYYY hh:mm'))<10, '1st Wave', 'Normal') AS FirstWave,

TimeStamp format on Main is set the following: 'DD/MM/YYYY hh:mm:ss[.fff]'

that's instead what I see in ScheduledDateTime field: 27/09/2014 11:15 (in Excel export it seems to be a text and not a number)

thanx