Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

LOAD data into QlikView

Hello!

 

I have the following table:

 

nr.    type    end date                   start date       Value

1        A          10-01-2018            01-01-2018     10

2        A           12-05-2018            01-05-2018     5

3        B           09-09-2018            01-09-2018      6

 

I need to get only rows with the latest end date. How can I do it within my LOAD statement?

The result shoud be: 

nr.    type    end date                   start date       Value

2        A           12-05-2018            01-05-2018     5

3        B           09-09-2018            01-09-2018      6

 

Thank you in advance for help!

 

Labels (1)
4 Replies
Mark_Little
Luminary
Luminary

HI,
Probably looking at something like.
LOAD
nr,
type,
date,
value,
From table
WHERE date= max(date);
Anil_Babu_Samineni

But, Why this row as well?
2 A 12-05-2018 01-05-2018 5
Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
marcus_malinow
Partner - Specialist III
Partner - Specialist III

Having loaded in your initial table,

 

RIGHT KEEP ([Your Table Name])

LOAD

    [nr.],

    max([end date]) as [end date]

RESIDENT [Your Table Name]

GROUP BY [nr.]

;

Anonymous
Not applicable
Author

Ok, I guess I need to make more clarification..

I have such table (a part of it), where a date '01.01.1753' means an empty space (in a specific database), this means, the price is open without the end date.

I need for each type get the record with the most actual end date.

This means:

 - if the end date is 01.01.1753 then this record,

- otherwise the record with the max(end date)

Example.jpg

 

The result have to be:

Result.jpg