6 Replies Latest reply: Oct 16, 2014 5:45 AM by Francesco Carmellini

# 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

• ###### Re: CALCULATED FIELD CREATION INTO QVD LOAD - WHAT'S WRONG IN THIS SYNTAX?

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

• ###### Re: CALCULATED FIELD CREATION INTO QVD LOAD - WHAT'S WRONG IN THIS SYNTAX?

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

• ###### Re: CALCULATED FIELD CREATION INTO QVD LOAD - WHAT'S WRONG IN THIS SYNTAX?

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')

• ###### Re: CALCULATED FIELD CREATION INTO QVD LOAD - WHAT'S WRONG IN THIS SYNTAX?

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",

• ###### Re: CALCULATED FIELD CREATION INTO QVD LOAD - WHAT'S WRONG IN THIS SYNTAX?

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?

• ###### Re: CALCULATED FIELD CREATION INTO QVD LOAD - WHAT'S WRONG IN THIS SYNTAX?

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