Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to add integer to Time (Minutes)?

Hi guys, Need some help...

I am trying to solve the following...

,Num(Mid(Time(WorkStart,'hh:mm'),4,2)) + Num(DateMinutes) as x2

where:

Time(WorkStart,'hh:mm') is equal to 07:00

DateMinutes is equal to 600

The result I am looking for is: 0+600 = 600 Instead I get 0.41666666666667

How do I work it around?

Thanks in advance,

Aldo.



1 Solution

Accepted Solutions
Not applicable
Author

=num(Timestamp(0.41666666666667) ) * 24 * 60


View solution in original post

6 Replies
johnw
Champion III
Champion III

I don't understand the question, but times are stored as fractions of a day. So 12 hours is stored as 0.5. 600 minutes is 0.41666666... days. So is your DateMinutes field actually an interval (also in fractions of a day) instead of an integer number of minutes?

In any case, if you want to add one to the other, they'll need to be the same sort of measurement, either fractions of a day or number of minutes or whatever.

Not applicable
Author

=num(Timestamp(0.41666666666667) ) * 24 * 60


Not applicable
Author

I am still checking it. I'll let you know.

Aldo.

Not applicable
Author

Hi Nick, based on your suggestion, I used:

,Date(RangeSum(Peek(WorkDateSequence),Num(TimeStamp(DateMinutes))),'DD/MM/YYYY hh:mm') as WorkDateSequence

Thanks,
Aldo.


Not applicable
Author

Maybe you don't need to use TimeStamp function if your DateMinutes field has Date/TimeStamp type. I used the TimeStamp function just to convert number to timestamp for reproducing your example.

Not applicable
Author

Yeap! you are right, Thanks.