Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to subtract hours to a Date field?

Hi,

I have a "Created Date" field in a table I created on QlikSense. How can I shift this Created Date back by 5 hours? There is a difference of 5 hours between what my table is showing and what my datasource has. Please see this screenshot for further elaboration:

table1.png

For the first Opportunity Name (Jillian Trattner), the time stamp on the "CreatedDate" (no space in between) says 12:36 AM on 12/5/2017. But my datasource says 7:36 PM on 12/4/2017, which is exactly 5 hours difference.

How can I set the "Created Date" field (space in between), so that these metrics align correctly with my datasource?

I tried [Created Date] + Hour(5) , but that didn't work. Thank you advance for your assistance!

3 Replies
petter
Partner - Champion III
Partner - Champion III

Date( [Created Date] + 5/24 , 'YYYY-MM-DD hh:mm:ss')

or even

Date( [Created Date] + MakeTime( 5 ) , 'YYYY-MM-DD hh:mm:ss')

Anonymous
Not applicable
Author

Hello,

Thank you for your help! I tried your suggestion in the "CreatedDate" field (third column in the table), and the changes worked.

However, the suggestion did not work for the "Created Date" field (the second column on the table with no timestamp). Is there a way I can fix that? This is what I see after making your suggestions on both columns:

Qlik1.png

Is there a way I can fix this? In the second column, I would like the date to match the info on the third column, but without the timestamp. Thank you very much!!

maxgro
MVP
MVP

Date(   Floor(   [Created Date] + 5/24 ) , 'YYYY-MM-DD')