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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
lakshman1031
Contributor III
Contributor III

Date wise Min and Max and Second Min Date value

Date wise Min date, max Date, Second Min date
 

Hi Team,

I have a date field like MM/DD/YYYY HH:MM

Date

04/2/2025 5:10

04/2/2025 5:11

04/2/2025 5:12

04/2/2025 5:15

05/2/2025 7:11

05/2/2025 7:26

05/2/2025 11:11

05/2/2025 11:50

 

Output:

--------------------------

 Min Date:

04/2/2025 5:10

05/2/2025 7:11

 Second Min date:

04/2/2025 5:11

05/2/2025 7:26

Max date:

04/2/2025 5:15

05/2/2025 11:50

 Thanks, advance.

Ram

Labels (3)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Something like:

Data:
Load TimeStamp(TimeStamp#(TS, 'MM/DD/YYYYY hh:mm')) as TS Inline [
TS
04/2/2025 5:10
04/2/2025 5:11
04/2/2025 5:12
04/2/2025 5:15
05/2/2025 7:11
05/2/2025 7:26
05/2/2025 11:11
05/2/2025 11:50
];
 
MinMax:
Load
  TheDate,
  TimeStamp(Min(TS)) as MinTS,
  TimeStamp(Min(TS, 2)) as MinTS2nd,
  TimeStamp(Max(TS)) as MaxTS
Group By TheDate;
LOAD 
  TS,
  Date(Floor(TS)) as TheDate
Resident Data;
 

View solution in original post

1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Something like:

Data:
Load TimeStamp(TimeStamp#(TS, 'MM/DD/YYYYY hh:mm')) as TS Inline [
TS
04/2/2025 5:10
04/2/2025 5:11
04/2/2025 5:12
04/2/2025 5:15
05/2/2025 7:11
05/2/2025 7:26
05/2/2025 11:11
05/2/2025 11:50
];
 
MinMax:
Load
  TheDate,
  TimeStamp(Min(TS)) as MinTS,
  TimeStamp(Min(TS, 2)) as MinTS2nd,
  TimeStamp(Max(TS)) as MaxTS
Group By TheDate;
LOAD 
  TS,
  Date(Floor(TS)) as TheDate
Resident Data;