Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I want to create a new field with input from multipel other fields as shown below.
timestamp1 | timestamp2 | timestamp3 | timestamp4 |
---|---|---|---|
a | b | ||
a | |||
a | b | c | d |
a | b | c |
Timestamp1-4 are always filled in the order a, b, c to d (timestamp2 can not have a value without a value in timestamp1)
Now I want to create a new field "result" to show the highest timestamp value.
example
a and b -> b
a, b and c -> c
Result |
---|
b |
a |
d |
c |
Thank you in advance!
Best regards
Malte
try: if(timestamp4,timestamp4,if(timestamp3,timestamp3,if(timestamp2,timestamp2,timestamp1)))
Hi,
You could add a statement like this in the script:
TableName:
Load *,
if(Time4>Time3 and Time4>Time2 and Time4>Time1 ,Time4),
if(Time3>Time4 and Time3>Time2 and Time3>Time1 ,Time3),if(Time1>Time3 and Time1>Time2 and Time1>Time4 ,Time1) as MaxTime
From SourceFile;
Hope that helps.
-Khaled
You can also use the concat function:
Load Department, concat(Name,';') as NameList from abc.csv group by Department;
Kind Regards,
Dion
try: if(timestamp4,timestamp4,if(timestamp3,timestamp3,if(timestamp2,timestamp2,timestamp1)))
Brilliant!
Brilliant!