Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
HJlassi1619437866
Contributor
Contributor

Help in parsing TimeStamp from GlobalVar to Query

Hello,

I want to stock a date (timestamp) in a variable to use it late in a query (PostgreSQL). so i used tsetGlobalVar and then in my query i used this query :

WHERE SX.\"Date\" = "+TalendDate.parseDate("yyyy-MM-dd'T'HH:mm:ss", (String)globalMap.get("row2.DateKey"))+"

And i get a java.lang.NullPointerException Error

I think the problem is in parsing Timestamp, please can anyone help me

Labels (4)
11 Replies
gjeremy1617088143

and you can use TalendDate.formatDate("yyyy-MM-dd'T'HH:mm:ss",row2.MaxDate) in your globalvar value

then you put it as a string in the query with (String)globalMap.get("DateKey")

gjeremy1617088143

you can also use to_char((your date value)::timestamp, 'yyyy-MM-dd'T'HH:mm:ss') in your postgre select to convert it directly to string