Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
saik
Contributor II
Contributor II

Help Needed

Hi Team,

I have a query related to Dates . Please go through below

I have a Date Field which is in the format of  1/15/2020 8:04:19 AM . I have to create a new field from this  like Date +72 hours(i.e 3 days).

Please suggest me some function to do this Job

 

Note : I am Novice User to qlik

 

Thanks.

Labels (1)
1 Solution

Accepted Solutions
saik
Contributor II
Contributor II
Author

Team,

Thanks for your time to reply . I got  Solution using Date() Function.

Return to Service( Date Field) :   2020-01-13 2:30:00 AM 

 

date ( [Return to Service]+3,'YYYY-MM-DD hh:mm:ss tt')

 

Thanks.

View solution in original post

4 Replies
pjaredchurch
Contributor III
Contributor III

To be string, this should work:

date#(<your_field>,'M/D/YYYY h:mm:ss tt')+3

Qlik doc's here

https://help.qlik.com/en-US/sense/November2019/Subsystems/Hub/Content/Sense_Hub/Scripting/Interpreta...

 

You may find that you can just do: 

<your_field>+3

 

In Qlik Sense dates are actually stored as numbers and 1 = 1 day, 0.5=12 hours etc.

saik
Contributor II
Contributor II
Author

Hi,

I am not able to get the expected result. Could you help me on this.

UserID2626
Partner - Creator III
Partner - Creator III

Set expression:

Timestamp(Max([Date_Field])+72/24,'D-MMM-YYYY h:mm:ss tt')

Timestamp(Max([Date_Field])+3,'D-MMM-YYYY h:mm:ss tt')

 

In Script:

LOAD
Business_Date as Date,
Timestamp(Business_Date+3,'D-MMM-YYYY h:mm:ss tt') as "Third Day",
Timestamp(Business_Date+48/24,'D-MMM-YYYY h:mm:ss tt') as "Second_Day",
//1/15/2020 8:04:19 AM
Pack as "Pack Type",
Pack,
Amount
FROM [lib://Path/Combochart Sample.xlsx]
(ooxml, embedded labels, table is Sheet1);

saik
Contributor II
Contributor II
Author

Team,

Thanks for your time to reply . I got  Solution using Date() Function.

Return to Service( Date Field) :   2020-01-13 2:30:00 AM 

 

date ( [Return to Service]+3,'YYYY-MM-DD hh:mm:ss tt')

 

Thanks.