Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

SQL Load help

Hi,

I have the below load statement and I would like to only bring in the latest date (ARDate) for each Voucher.

LOAD UserID,
Date as ARDate,
Voucher,
Status,
Action as ARAction
FROM

(
biff, embedded labels, table is [Action Summary$]);

For example if I have the below, I only want to bring in the last line:

ARDate          Voucher   ARAction

08/03/2017     1234-1     Contact ABC

09/03/2017     1234-1     Contact BCD

10/03/2017     1234-1     Contact CDE

Hope the above makes sense.

Regards,

Daniel

3 Replies
sunny_talwar

May be do this

Table:

LOAD UserID,
Date as ARDate,
Voucher,
Status,
Action as ARAction
FROM

(biff, embedded labels, table is [Action Summary$]);

Right Join (Table)

LOAD Voucher,

    Max(ARDate) as ARDate

Resident Table

Group By Voucher;

vinieme12
Champion III
Champion III

Hi Sunny, do you think Right Keep, will perform better?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
sunny_talwar

Between the two, I don't think Keep or Join should be different.... but can be tested out. I think the best technique would be to use Peek/Previous if the data is well sorted. By well sorted I mean, the data is sorted first by Voucher and then by descending order of date