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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Max date

Hi,

I have data as below

Emp     Date                    Sal     Grade

ABC     01/27/2012          100     A

ABC     02/27/2012          200     B

DEF     3/31/2012            100     B

DEF      5/31/2012          400     C

My requirement is I have to pick Grades and salaries of only latest date for each employee and show it in pie chart...

so ideally I should only pick salaries and grades of employee of ABC Dated 2/27/12  and 5/31/2012 for DEF

currently Im using below formula in pie chart..

 

sum(salary)/sum(total slalary) so this forumla picks salaries for all records..I want this to pick only salaries and grades of recent dates for each emp and do the calcuation

any help is highly appreciated..

10 Replies
rlp
Creator
Creator

Use the following code:

max_table:

NoConcatenate

LOAD

     Emp ,

     Max( Date ) as Date

RESIDENT <your_table>

GROUP BY Emp

;

LEFT JOIN( max_table )

LOAD

     *

RESIDENT <your_table> ;

DROP TABLE <your_table> ;