This field is required.
Only these extensions are allowed(.jpg, .JPG, .jpeg, .JPEG, .gif, .GIF, .png, .PNG)
Tags cannot contain the characters ' /, \\, #, ?, or ; >,< '
Only these extensions are allowed(.zip,.ZIP,.pdf,.PDF,.qvf,.QVF,.qvw,.QVW)
Discussion Board for collaboration related to QlikView App Development.
i need to calculate the difference between two dates in Seconds. start date: 6/8/2015 23:32:35 and End Date 6/8/2015 23:32:50.
Please suggest me the formula.
In the script, your timestamp format should be set accordingly:
SET TimestampFormat = 'M/D/YYYY hh:mm:ss';
Then you can load your values just use interval():
=interval( [End Date]-[Start Date],'ss')
or if you want to do further calculcation in units seconds:
=num#(interval( [End Date]-[Start Date],'ss'))
View solution in original post
In my document the time format is set like this TimestampFormat='M/D/YYYY hh:mm:ss[.fff] TT'; and in the script i have given Interval(END_DATE-START_DATE,'ss'). But I am getting the result as 00 only.
try tis way,
=Interval(Interval(Sum(ProProductiveTime),'hh:mm:ss') - Interval(Sum(ProNonProductiveTime),'hh:mm:ss'),'hh:mm:ss')
You need to interpret the field values correctly before you can perform numeric calculations. If you don't want to change your global script settings, try
interval( timestamp#([End Date],'M/D/YYYY hh:mm:ss')-timestamp#([Start Date],'M/D/YYYY hh:mm:ss'),'ss')
Try this in script.
Interval(timestamp#(End_Date, 'mm/dd/yyyy hh:mm:ss') - timestamp#(start_date, 'mm/dd/yyyy hh:mm:ss'), 'ss') as IntervalT
start_date , End_Date
6/8/2015 23:32:35, 6/8/2015 23:32:50
I couldnt solve the issue using any of the above Suggestions. I am getting '_' as a result of this. Please help me to solve this
can u share ur app and expected output?
the Issue is fixed now. Due to some reasons the time format was wrong and that was causing the issue. And now i am able to find the difference using the Interval function alone. Thank you all for the valuable time.
Interval(Timestamp#(EndDate,'D/M/YYYY hh:mm:ss')-Timestamp#(StartDate,'D/M/YYYY hh:mm:ss'),'ss')
6/8/2015 23:32:35,6/8/2015 23:32:50