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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Straight Table filtering

Hi,

In the Straight Table below, I only want to load those PO_NO where the Status is 200 and on the min date. (They are same PO with same Status 200 but different date, due to change in Status back and fore)

e.g for PO_NO 123, I only wants to load the PO where the status is 200 and the first Date is 12/12/2013, igore the same PO dated 12/13/2015, 12/14/15. Same for the rest of the PO.

I tried min(date(PO_NO) as MinPoDate but failed.

Appreciate anyone could help. Thank you.

[TrackTraces]:

Load   

   PO_NO, StatusDate, Status,

              FROM [Track.qvd] (qvd) ;

  

PO_NOStatusDateStatus
12312/12/2015200
12312/13/2015200
12312/14/2015300
12412/12/2015200
12412/13/2015200
12412/14/2015400
12512/12/2015200
12512/13/2015200
12512/14/2015450
1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

HI,

Try like this

[TrackTraces]:

Load  

   PO_NO, Min(StatusDate) AS StatusDate, Status,

              FROM [Track.qvd] (qvd)

WHERE Status = 200

GROUP BY PO_NO, Status;

Regards,

Jagan.

View solution in original post

3 Replies
swuehl
MVP
MVP

Maybe like this:

SET DateFormat = 'MM/DD/YYYY';

Filter:

Load  

   PO_NO & '-' & num(Min(StatusDate)) as Filter

FROM [Track.qvd] (qvd)

WHERE Status = 200

GROUP BY PO_NO;

[TrackTraces]:

Load  

   PO_NO, StatusDate, Status,

FROM [Track.qvd] (qvd)

WHERE EXISTS(Filter, PO_NO & '-' & num(StatusDate)) and Status = 200;

DROP FIELD Filter;

Not applicable
Author

Hi ,

The statement should be RESIDENT [Shipment], Sorry was my mistake , it was not taken from QVD but from a Table [Shipment]. After I re-load, I have "$Syn 1 error" for PO_NO, StatusDate, Status as these 3 fields also appear in [Shipment] Table, how to resolve this. Appreciate your help. Thank you.

Filter:

Load  

   PO_NO & '-' & num(Min(StatusDate)) as Filter

RESIDENT [Shipment]

WHERE Status = 200

GROUP BY PO_NO;

[TrackTraces]:

Load  

   PO_NO, StatusDate, Status,

RESIDENT [Shipment]

WHERE EXISTS(Filter, PO_NO & '-' & num(StatusDate)) and Status = 200;

DROP FIELD Filter;

jagan
Partner - Champion III
Partner - Champion III

HI,

Try like this

[TrackTraces]:

Load  

   PO_NO, Min(StatusDate) AS StatusDate, Status,

              FROM [Track.qvd] (qvd)

WHERE Status = 200

GROUP BY PO_NO, Status;

Regards,

Jagan.