Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
KKumar92
Contributor III
Contributor III

Creating a Customer Date in Data Load Script

Hi All,

I want to create a custom date for one of my qlik application.

Below is My Scenario, I am running a production plant where my operation will for 24 hrs. (Today - 7/10/20, 6.00 am to Tomorrow - 8/10/2020 6.00 am), But I want to display total units produced during this time period on 7/10/2020, where as total units produced on 8/10/2020 will be the units produced between 8/10/2020, 6.00 am to 9/10/2020, 6.00 am

I have used the following scrip in my data loading script

Date(If(Hour(prod_Time)>6,Date((prod_Time)+1),Date(prod_Time)),'MM/DD/YYYY') as Prod_Time

However, this only calculates the production of 7/10/2020 from 6.00 am, not the production of 8/10/2020 till 6.00am

Appreciate your support and Guidance on This matter.

Labels (3)
2 Replies
avinashelite

Take a look at the day start function in Qlik , that will solve your problem 
https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/Scripting/DateA...

 

avinashelite

In your case expression would look like 

daystart(Date_timestamp_field ,0, 0.25 )

0.25 is the offset for 6 AM