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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
slvedva123
Contributor II
Contributor II

Compare time field

Hi,

Maybe someone can help with correct script. I have data table like below:

slvedva123_0-1639224223019.png

For each line I want to compare the time window and give value.

Like if time is from 14:00:00 till 14:59:59, than value 1; if time is from 15:00:00 till 00:00:00, than 2.

I tried with this :

if(time(time([TIMEFIELD],'hh:mm:ss'))>='14:00:00' and time(time([TIMEFIELD],'hh:mm:ss'))<='14:59:59','1','2'), but it's don't work, for all records system give value 2.

 

Labels (1)
1 Solution

Accepted Solutions
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Try Tmestamp()

Timestamp(Timestamp#(INSERTDTM,'dd.mm.yyyy hh:mm:ss'),'hh:mm:ss')

View solution in original post

6 Replies
AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Hello,

The same expression works at my end.

AshutoshBhumkar_0-1639227458891.png

Can you share some sample data ?

Thanks,

Ashutosh

slvedva123
Contributor II
Contributor II
Author

I use app on QlikSense server, how I can share these data?

slvedva123
Contributor II
Contributor II
Author

Maybe it's somehow related, that this original field look like this: 2021-12-11 15:26:50 and with time funtion I take time 15:26:50

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

That should still work fine.

slvedva123
Contributor II
Contributor II
Author

I use this function to convert time - time(time([INSERTDTM],'hh:mm')), but when I download this field in excel, it's show like this - "07.01.2021 13:06:15", how to really convert, that system take only time, without date?

AshutoshBhumkar
Partner - Specialist
Partner - Specialist

Try Tmestamp()

Timestamp(Timestamp#(INSERTDTM,'dd.mm.yyyy hh:mm:ss'),'hh:mm:ss')