Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate Time format with Number

Hello everyone,

                   I got the following question: i need to calculate "Time (in hours)"*"Quantity_per_hour(number)". I am importing data from SQL server, where the field for time is in format "time". Field for quantity is from excel file and its in format number. Is there a way to convert time to number format ? I am doing my calculation as expression.

     My idea: for example I got 02:00 hours. I need to convert it to 2.00 decimal so i can multiply it with the quantity.

All ideas will help .

Best regards

Daniel.

11 Replies
Not applicable
Author

Num(SubField("Starting Time", ':',1)) +  (Num(SubField("Starting Time", ':',2))/60) as [Start time_decimal],

Num(SubField("Starting Time", ':',1)) +  (Num(SubField("Starting Time", ':',2))/60) as [End time_decimal],

"Starting Time" + "Ending time"+"Break Start Time"+"Break End Time" are time format. What I tried is to show just [Start time_decimal] as expression to see if it works. The output is "-" for all data formats from menu : Number, Interval, Time and so on....

MarcoWedel

Hi Daniel,

maybe these examples help:

for genuine time fields:

QlikCommunity_Thread_125103_Pic1.JPG.jpg

for text fields containing time strings:

QlikCommunity_Thread_125103_Pic2.JPG.jpg

regards

Marco