Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can someone explain why the timestamps per ID are in different rows? (and how to fix it)
load Id,
if(type=1,Timestamp(timeD)) as Timestamp1,
if(type=2,Timestamp(timeD)) as Timestamp2,
if(type=3,Timestamp(timeD)) as Timestamp3
where statetext='Finished'
from ...
Hi
Try like below
load Id,
max(if(type=1,Timestamp(timeD))) as Timestamp1,
max(if(type=2,Timestamp(timeD))) as Timestamp2,
max(if(type=3,Timestamp(timeD))) as Timestamp3
from urtable
where statetext='Finished'
group by Id;
In that case, u can get in one row.
Could you supply more details around the data model, With the times being different it suggests there are multiple rows for where the condition is met.
Add ROWNO() AS TestID,
Seeif you get different row numbers.
Hi
Try like below
load Id,
max(if(type=1,Timestamp(timeD))) as Timestamp1,
max(if(type=2,Timestamp(timeD))) as Timestamp2,
max(if(type=3,Timestamp(timeD))) as Timestamp3
from urtable
where statetext='Finished'
group by Id;
In that case, u can get in one row.
This solution works, thank you:)