Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have trouble loading data from postgres field of type TimeWithZone.
I can normally load it, and see it in Data model viewer.
The problem is when I try to get min(), max() or amy function. It always return NULL.
So let say that I have "time" field in postgres of TimeWithZone type.
LOAD
min(time) as start,
max(time) as stop
Resident temp_database
group By id;
Return all null rows.
I even try
LOAD
min(Time(time)) as start,
max(Time(time)) as stop
Resident temp_database
group By id;
and
LOAD
min(Time#(time)) as start,
max(Time#(time)) as stop
Resident temp_database
group By id;
I also try
LOAD
Num(time) as nTime,
Chr(time) as cTime
Resident temp_database;
return all null rows.
How to handle this type of fields?
First you need to play with Time Format from TimeZone?
I found that I was wrongly choose chr() insted of Text()
Now I have : Time#(Text(time)) -> it return values
but
min(Time#(Text(time))) -> return null
I am not sure what inputs is having from time?
If the field is being treated as string, you might have to use parsing functions like time#(), date#(), timestamp#() with proper format. Try like:
Timestamp(Max(Timestamp#(time,'format') )) as Stop
'format' - is the one how you see when the field is loaded without max/min.
NUra is Num(time)
WUra is Time#(Text(time))
Those two rows are
min(Time#(Text(time)))
max(Time#(Text(time)))
Till you are using Text() it will always return text format only.
Sorry but I don't understand you.
I use Time#(Text(time)) so, it should return Time not Text...
Could you explain what do you mean by your comment.
Hi,
Could you look to my reply to other answers.
Difficult to answer, Without having any inputs. Can you provide inline and result set?May be this
Time(Time#(time), 'hh:mm:ss')