Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression in Script

Hello All,

I am having two fields say, StartTime & EndTime. Now I am creating EndTime-StartTime as SessionDuration. But with this expression values are repeating like if a session was of 30 min then it is repeating 2 times which should not happened.

Is it require any function?

Regards,

Balraj

3 Replies
avinashelite

Hi Balraj,

Can you kindly provide us the sample data, so that we can trace the exact problem and work for the solution.

Regards,

@vi

parthiband
Partner - Creator
Partner - Creator

Hi Balraj,

I didn't get ur problem clearly.

Anyway, u should not subtract anything if it is a period field (Example, Date, Time etc)

U should use

Interval(EndTime - StartTime, 'HH:MM:SS')

Thanks,

its_anandrjs

Use Interval function or may be use it with the primary key values suppose if there are different keys but duration is same like

Key, Duration

4, 30 Min

5, 30 Min

5, 20 Min

Ex:-

Load

Id as %Key,

StartTime,

EndTime,

Interval(EndTime - StartTime, 'hh:mm:ss') as Duration

From Location;