Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
alvinford
New Contributor III

How to generate Start Time

Hi All,

Facing issue with the time. Need to generate the start time based on the end time and duration.

I have event end time as 00:20:00 (hh:mm:ss) and Duration as 3:20:00(hh:mm:ss).

How can I get the Start Time i.e 09:00:00.

Request your help.

Thanks in Advance.


Regards,
Alvin.
1 Solution

Accepted Solutions

Re: How to generate Start Time

See attached qvw


talk is cheap, supply exceeds demand
11 Replies

Re: How to generate Start Time

EndTime - Duration should give you the start time, 21:00:00 (or 09:00:00 PM) in your case, not 09:20:00. Make sure you work with dates and times, not strings. Use the date# and time# functions if necessary to create dates and times from strings.


talk is cheap, supply exceeds demand
er_mohit
Honored Contributor II

Re: How to generate Start Time

hiii...

Interval(time(endtime,'hh:mm:ss')-Time(Duration,'hh:mm:ss'),'hh:mm:ss') as Start_Time

Not applicable

Re: How to generate Start Time

= interval (Time(Time#('12:20:00','hh:mm:ss')) - interval(Time(Time#('3:20:00','hh:mm:ss'))-Time(Time#('0:20:00','hh:mm:ss')),'hh:mm:ss'),'hh:mm:ss')

Bold - Specify hr's format. If you use 12hr Format Specify 12, else 24.

Hope this helps

alvinford
New Contributor III

Re: How to generate Start Time

Thanks Gisbert I have rectified the output value.

Regards,

Alvin.

alvinford
New Contributor III

Re: How to generate Start Time

Hi Mohit,

Its not giving the desired results.

Regards,

Alvin.

alvinford
New Contributor III

Re: How to generate Start Time

Hi Streak,

I can't catch up your logic. I have added the sample data in the Excel with columns EndTime and Duration. Can you please help to achieve StartTime.

Please find the  attachment.

Regards,

Alvin.

Not applicable

Re: How to generate Start Time

Copy the expression and put inside the text object, you will see what your

are expecting.

alvinford
New Contributor III

Re: How to generate Start Time

Hi Streak,

I have already verified that.Can't get the expected values.

Regards,

Alvin.

alvinford
New Contributor III

Re: How to generate Start Time

Can you please help ...

Regards,

Alvin.

Community Browser