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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
chiru_thota
Specialist
Specialist

Time difference between max date and minimum date

Hi All,

I have a log file and reading the data.

my aim is to get time taken for execution.I am able to read the data.But not able to calculate the difference.

I am attaching QVW.

Thanks in advance.

ChiruLoad time.jpg

1 Solution

Accepted Solutions
Not applicable

=(date(max(date#(QVWLoadTime, 'MM/DD/YYYY hh:mm:ss')),  'MM/DD/YYYY hh:mm:ss')) - (date(min(date#(QVWLoadTime, 'MM/DD/YYYY hh:mm:ss')),  'MM/DD/YYYY hh:mm:ss'))

That expression will give you the difference.  The way that you were doing it on your example just said max(QVWLoadTime), but qlikview wasn't told how to interpret the value of that string.  So the date# is an interpreter function that tells qlikview what each number in the field means and thus is able to determine the min and max via the functions.  Hopefully this is what you were looking for or at least points you in the right direction.

View solution in original post

2 Replies
Not applicable

=(date(max(date#(QVWLoadTime, 'MM/DD/YYYY hh:mm:ss')),  'MM/DD/YYYY hh:mm:ss')) - (date(min(date#(QVWLoadTime, 'MM/DD/YYYY hh:mm:ss')),  'MM/DD/YYYY hh:mm:ss'))

That expression will give you the difference.  The way that you were doing it on your example just said max(QVWLoadTime), but qlikview wasn't told how to interpret the value of that string.  So the date# is an interpreter function that tells qlikview what each number in the field means and thus is able to determine the min and max via the functions.  Hopefully this is what you were looking for or at least points you in the right direction.

Not applicable

hey Chiranjeevi,

I believe its as a string and not as a dual date. It has only the string part and the number part is not associated with it.

To test it just select one and in a text box put num(QVWLoadTime). If you get a number then its dual else its only as a string.

You have to change the format using date#() function.

Date#(QVWLoadTime,'MM/DD/YYYY hh:mm:ss')

Hope it helps

Thanks

AJ