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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Writing a Expression to subract dates,

Hi,

I want to write a expression in which i need to subtract the two dates field and i need to convert the result field in to hours, days and minutes. I am looking for the syntax to follow and little confused with the functions to use,

Any help will be highly appreciated,

Thanks,

Praveen.

Labels (1)
25 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

  Can you please share what you tried and what u expect.

  If possible pls post the qvw file.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

interval(DISCHARGE_TIME - ADMISSIONTIME,'hh:mm:ss') am using this expression in the output it shows like

('2010-11-12' 55:11:22)

('2011-15-16' 42:10:01)

I need only hrs:mm:ss in the output and i dont need date in the output. Also i need to sum all the hrs, minutes and seconds and display it in one row,

For above eg,

the output i like to see is  97:21:23..

Any suggestions to write expressions?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

HI,

     It seems that the data formate for DATE field is not proper.

     If possible please sens us the sample file.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

Hi,

How to upload the sample file i find no ways to attach the file.

Kaushik Solanki wrote:

HI,

     It seems that the data formate for DATE field is not proper.

     If possible please sens us the sample file.

Regards,

Kaushik Solanki

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Use Advanced editor which is right of the reply editor.

Celambarasan

Not applicable
Author

Hi,

Pls find the qvw file. Please find the last tab of the report.

Thanks,

Praveen.

Not applicable
Author

i have attached the qvw file. check to it.

jagan
Partner - Champion III
Partner - Champion III

Hi,

Check the attached file, I added the dimensions Discharge and Admission Time and removed D in the Time format.  It displays the difference between the two in hours: seconds format.

Regards,

Jagan.

Not applicable
Author

Hi,

can you send me the expression alone here, i cant open the qvw u posted , since i am using personal edition.

Thanks,

Praveen.

jagan
Partner - Champion III
Partner - Champion III

Hi,

I used this expression

=interval( ADMISSIONTIME - DISCHARGE_TIME,'hh:mm')

Regards,

Jagan.