Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Qlikview User
Within the load I have a field called Total Time
The field is calculating the difference between 2 date fields
The Total Time field is calculated as follows:
(TimeA - TimeB) * 1440 AS Total Time
However I am returning values such as 4.890679000000000
Could someone kindly help me return a number with 0 decimal places
Kind Regards
Helen
Did you try this:
Round((TimeA - TimeB) * 1440) As TotalTIme
Is the number 4.890679 the correct number? You just want to round it? Do you want this to be Round up, round down or a regular round?
Maybe:
Interval(TimeA - TimeB, 'm') as TotalTime
or
Interval(TimeA - TimeB, 'mm:ss') as TotalTime
if you want to keep the seconds.
hope this helps
regards
Marco
you can use floor() or ceil() functions to force rounding up or down, or if you are ok with the automatic rounding, you can use formatting instead num(((TimeA - TimeB) * 1440), '##0')
If TimeA and TimeB is accurately formatted, you will find the difference as Marco described above.
If the TimeA and TimeB are not accurately formatted as timestamps, you should look into how to accomplish this. Correctly formatted date, time and timestamp fields will allow you to utilize the date and Time functions.
4.890679 in Qlik means 4 days, 21 hours and 22 minutes. Is this the interval you expect from your calculation?
If not, please provide an example so that we can advise on how to change the formatting.
Hi helen_pip,
NUM(( TimeA - TimeB)* 1440,'##0') AS Total Time
Hello Vish
Thank you for your suggestion on this yesturday, I have tried your suggestion and this works for me
Kind Regards
Helen