Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

hurricanemoe201
New Contributor III

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!

Tags (1)
3 Replies
MVP
MVP

Re: How to subtract hours to a Date field?

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

or even

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

hurricanemoe201
New Contributor III

Re: How to subtract hours to a Date field?

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!!

MVP
MVP

Re: How to subtract hours to a Date field?

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

Community Browser