Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can you add an integer to the result of a date and time function?

The script below returns the values (intergers) 1-24

Hour (`date_entered`)

How do I add the integer value '1' to the result. I wanted the script below to display something like '07:00-8:00'

Here's what I tried:

Hour (`date_entered`) & ':00' & '-' & Hour (`date_entered` + 1) & ':00' as Hour,

Can anyone help?

1 Solution

Accepted Solutions
Not applicable
Author

Thanks for the help! Just adjusted my original script...

    Hour(`date_entered`) & ':00' & ' - ' & (Hour(`date_entered`)+1) & ':00' as Hour,

View solution in original post

2 Replies
richard
Partner - Creator
Partner - Creator

This would do. Try it in a text object first.

Notice! 

1) replace now(0) with your date field.

2) This script adds 1 to the hour and not 60 minutes to the time. This is a  big difference.

=date(now(1),'hh:mm') & ' - ' &  (hour(date(now(1),'hh:mm')) +1) & ':' & minute(date(now(1),'hh:mm'))

Not applicable
Author

Thanks for the help! Just adjusted my original script...

    Hour(`date_entered`) & ':00' & ' - ' & (Hour(`date_entered`)+1) & ':00' as Hour,