Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New 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
Highlighted
New Contributor II

Re: Help Needed

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
Highlighted
New Contributor III

Re: Help Needed

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.

Highlighted
New Contributor II

Re: Help Needed

Hi,

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

Highlighted
Contributor II

Re: Help Needed

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);

Highlighted
New Contributor II

Re: Help Needed

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