Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
aveeeeeee7en
Specialist III
Specialist III

Min In DateTime & Max Out DateTime against Distinct TicketID in the Best Possible Way

Hi All

I have to find Min In DateTime  Max Out DateTime against Distinct TicketID

Below I am using the Code to find Min & Max Date.

My Questions are:

1) Is the code I am using is the correct way

2) Is there any other alternate way

3) Can I use First Sorted Value

See my Code:

Table:
LOAD TicketID,
     SerialNumber,
     CreationDateTime
FROM

(qvd);

Left Join

LOAD TicketID,
     InDateTime
FROM

(qvd);

Left Join(Table)

LOAD TicketID,
     ENG_OUT_TIME
FROM

(qvd) WHERE MATCH(UPPER(STATUS),'CLOSED','TELE CLOSURE','MACHINE UNDER OBSERVATION');

PFA.

Regards

Av7eN

4 Replies
anbu1984
Master III
Master III

You can use FirstSortedValue to get min and max date

aveeeeeee7en
Specialist III
Specialist III
Author

First Sorted Value is nice But the Code I am using is the right Approach or not.

Kindly Suggest.

Anonymous
Not applicable

Hi,

Use the code like in the attachments...

anbu1984
Master III
Master III

If you don't need other than Min value, then you calculate Min before Join


LOAD TicketID,

     Min(InDateTime)

FROM

(qvd)

Group By TicketID;