Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
master_student
Creator III
Creator III

time comparaison

Hello everyone,

I need to display the first time after 13:00:00

with this script, I only display all timings after 13h

if(

                         // Compare if the time from DATE_DEB

                         time(DATE_DEB,'DD/MM/YYYY hh:mm:ss')

                         // is greater then

                         >

                         // 13:00:00

                        time(date(floor(DATE_DEB) ,'DD/MM/YYYY') + time(MakeTime(13),'hh:mm:ss'),'DD/MM/YYYY hh:mm:ss') ,

                     

                       

                       

                         // if so, DATE_DEB

                        time(DATE_DEB),

                         // If not, null() value

                        null()

                 )  as DATEE,

DATE_DEB has this format : 12/05/2015 13:00:00

Ce message a été modifié par : master student

10 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Didn't you post this same question earlier? Please don't duplicate your post - it creates clutter and confusion.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sunny_talwar

Hi master_student‌ -

We understand that you are eager to find a solution, but opening multiple threads (one after the other) is not going to help. Use one thread and explain what exactly are you looking for, because until you do so, you won't find a solution and the community will be spammed by your multiple threads.

To me all these threads are asking for the same thing, isn't it?

time

maximum time

condition

Best,

Sunny

master_student
Creator III
Creator III
Author

no. it isn't the same pb

el_aprendiz111
Specialist
Specialist

HI

1 example:

=IF(Frac(NOW())*100>=50,WeekDay(Today()),Year(Today()))

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

See this code:

                     if(

                         // Compare if the time from DATE_DEB

                         time( timestamp(DATE_DEB,'DD/MM/YYYY hh:mm:ss') )

                         // is greater then

                         >

                         // 13:00:00

                        time( timestamp(date(floor(DATE_DEB) ,'DD/MM/YYYY') + time(MakeTime(13),'hh:mm:ss'),'DD/MM/YYYY hh:mm:ss') ),

                         // if so, DATE_DEB

                        DATE_DEB,

                         // If not, null() value

                        null()

                 )  as DATE

Best regards,

D.A. MB

master_student
Creator III
Creator III
Author

the result is like that 42432,2

sunny_talwar

You need the time component only?

If(Time(Frac(TimeStamp#(DATE_DEB, 'DD/MM/YYYY hh:mm:ss'))) > MakeTime(13), Time(Frac(TimeStamp#(DATE_DEB, 'DD/MM/YYYY hh:mm:ss')))) as TIME

miguelbraga
Partner - Specialist III
Partner - Specialist III

Try this:

if(

                         // Compare if the time from DATE_DEB

                         time( timestamp(DATE_DEB,'DD/MM/YYYY hh:mm:ss') )

                         // is greater then

                         >

                         // 13:00:00

                        time( timestamp(date(floor(DATE_DEB) ,'DD/MM/YYYY') + time(MakeTime(13),'hh:mm:ss'),'DD/MM/YYYY hh:mm:ss') ),

                         // if so, DATE_DEB

                       Date(DATE_DEB),

                         // If not, null() value

                        null()

                 )  as DATE

master_student
Creator III
Creator III
Author

Hi Miguel,

Thank you for your reply. I appreciate your help.

I changed your code as follow :

if(

                         // Compare if the time from DATE_DEB

                         time(DATE_DEB,'DD/MM/YYYY hh:mm:ss')

                         // is greater then

                         >

                         // 13:00:00

                        time(date(floor(DATE_DEB) ,'DD/MM/YYYY') + time(MakeTime(13),'hh:mm:ss'),'DD/MM/YYYY hh:mm:ss') ,

                         // if so, DATE_DEB

                        time(DATE_DEB),

                         // If not, null() value

                        null()

                 )  as DATEE,

It works but I have a problem; whene I have more then one time>13 => I have to display the first one, any suggestions?