Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

qliktech_uk
Not applicable

Date part missing.

Hi

I have a field taken from a spreadsheet that has a timestamp however for few records it just has the time. How do I populate the missing date? WHen I calculate the interval I get the wrong figures as its subtracting  time (epoch date I assume)  from the timestamp.

eg: 11:30:00  - 23/10/2017 11:10:10

Your help is appreciated.

Tags (1)
6 Replies
loveisfail
Not applicable

Re: Date part missing.

What are you expecting from above timestamp?

Life is so rich, and we need to respect to the life !!!
qliktech_uk
Not applicable

Re: Date part missing.

I just need to get the time difference. I tried stripping off the date part but wasnt successfull.

eg: 11:30:00  - 23/10/2017 11:10:10

So the above example should give me 20.

qliktech_uk
Not applicable

Re: Date part missing.

Can I use the function right and get the time part?

loveisfail
Not applicable

Re: Date part missing.

May be this?

=Interval(Frac(Date(Date#('FieldName1,'hh:mm:ss'),'mm') - Date(Date#(FieldName2, 'DD/MM/YYYY hh:mm:ss'),'mm')),'mm')

Life is so rich, and we need to respect to the life !!!
tresesco
Not applicable

Re: Date part missing.

If the fields are already timestamps, you could simply try like:


Interval(Field1-Frac(Field2), 'm')


If the fields are string, convert them using parsing functions like date#(), timestamp#().. and then apply the same logic

its_anandrjs
Not applicable

Re: Date part missing.

Then why not remove dates from the rows also and do interval match for the hh:mm:ss

Interval( Field1  -  TimeStamp(TimeStamp#(Right(Field2,8),'hh:mm:ss'),'hh:mm:ss') , 'mm')