Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, how do i create a column called 'before 10am' using if then statement? The underlined part has error.
LOAD * INLINE [
Before 10am
];
if([Time]<='10:00:00') then ([Before 10am]=1);
Thanks.
try this
if([Time] <= '10:00:00',([Before 10am]=1))
Do you want the value of the field to be set '1' or '0', if so then try like:
load
If( yourcondition, 1,0) as [Before 10am]
MYTAB:
LOAD * INLINE [
Name
John
Luis
Alex
];
Load
*,
if(Name = 'Alex', 'Alex The Great', Name) as newName
resident MYTAB;
Drop Table MYTAB;
Hope it helps
elaborate the question , i think you need to create a coumn in front end or backend then you directly use maketime(hh,m,ss)
like below :
in script:
if([Time]<=maketime(10,0,0) ,1,0) as Before10am
or
in front end expression :
if([Time]<=maketime(10,0,0) ,1,0)
Sorry, none of the answers worked. I want the column 'before 10am' to be 1 if the column 'time' is >=10:00:00, else it will be 0. Thanks.
Hi,
Try this..
Load
if(Timestamp(time,'hh:dd:ss')>'10:00:00',1,0) as [before 10am]
From <YourTable> ;
Thanks,
Prabhu
If( Time >= '10:00:00' , 1,0) as [Before 10am]
Hi Rachel,
I would use:
LOAD
if( time#([Time], 'hh:mm:ss') < time#('10:00:00', 'hh:mm:ss'), 'Before 10am') as TimeBefore10am
...
FROM
- Ralf