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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
fcecconi
Partner - Creator III
Partner - Creator III

Time Difference in load script

Hello

I am trying to create a new column that is a difference in minutes between 2 different times, but the calculation is returning 00.

thanks Frank

Load

Option_Desc,

note_type_value,

data_entry_date,

data_entry_time,

service_duration,

service_charge_value,

date_of_group_service,

date_of_service,

date_of_note,

New_Existing_Service_value,

NUM(ss_note_date_1) as ss_note_date_1_Key,

ss_note_date_1,

ss_note_time_1,

ss_note_time_2,

draft_final_code,

note_type_code,

interval(time(ss_note_time_2, 'hh:mm TT') - time(ss_note_time_1,'hh:mm TT'),'mm') as IS_Duration

1 Solution

Accepted Solutions
sunny_talwar

So it seems that your time field is not read as time field by QlikView... You probably will need TimeStamp#() or Time#() function to get this done

Interval(Time#(ss_note_time_2, 'TimeFieldFormat') - Time#(ss_note_time_1, 'TimeFieldFormat'), 'mm') as IS_Duration

View solution in original post

3 Replies
sunny_talwar

Can you check what you get when you do just this

ss_note_time_2 - ss_note_time_1

Do you see a decimal number or not?

If you do, then you can try just this

Interval(ss_note_time_2 - ss_note_time_1, 'mm') as IS_Duration

fcecconi
Partner - Creator III
Partner - Creator III
Author

Sunny

it is null.

sunny_talwar

So it seems that your time field is not read as time field by QlikView... You probably will need TimeStamp#() or Time#() function to get this done

Interval(Time#(ss_note_time_2, 'TimeFieldFormat') - Time#(ss_note_time_1, 'TimeFieldFormat'), 'mm') as IS_Duration