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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
etrotter
Creator II
Creator II

Load only Latest Date

Hello,

I have this table:

Temp:

Load Distinct

Worker_ID,

Base_Rate,

Compensation_Effective_Date

Resident Compensation;

I would like to only show the Base Rate from the most recent Compensation_Effective_Date. I have tried with a where statement, a lastvalue functions, but I have yet to get either of them to work.

I'd appreciate if you could help, thanks in advance!

1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try this

Temp:

Load Distinct

     Worker_ID,

     Base_Rate,

     Compensation_Effective_Date

Resident Compensation;

Right Join (Temp)

LOAD Worker_ID,

     Max(Compensation_Effective_Date) as Compensation_Effective_Date

Resident Temp

Group By Worker_ID;

View solution in original post

1 Reply
sunny_talwar
MVP
MVP

Try this

Temp:

Load Distinct

     Worker_ID,

     Base_Rate,

     Compensation_Effective_Date

Resident Compensation;

Right Join (Temp)

LOAD Worker_ID,

     Max(Compensation_Effective_Date) as Compensation_Effective_Date

Resident Temp

Group By Worker_ID;