Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I have 2 tables, Transaction and Employee level history.
Transaction :
Emp_ID | Amount |
---|---|
1 | 10 |
1 | 15 |
1 | 25 |
2 | 11 |
2 | 12 |
Employee_Level_History:
Emp_ID | Level | End_Date_Level |
---|---|---|
1 | A | 01/01/2010 |
1 | B | 02/02/2010 |
2 | A | 03/03/2010 |
2 | C | 03/03/2010 |
Based on above data, i need to show latest employee level in text box, which that employee have the most amount.
So the result in text box should show level B.
Which is level B is owned by emp_id 1, that have the most amount.
How to solve that?
I can show the first emp_id in text box with below script, but i don't know how to show the latest level of highest emp_id amount.
=firstsortedvalue( Emp_ID, aggr(min(if(aggr(Rank(sum(Amount)),Emp_ID)=1,Emp_ID)),Emp_ID))
Many thanks,
Best Regards
Take care that your End_Date_Level is interpreted as date:
Set DateFormat = 'MM/DD/YYYY'; // Or adjust to your date format
Then this should work in your text box:
=FirstSortedValue({<Emp_ID = {"=Rank(Sum(Amount))=1"}>} Level, -End_Date_Level)
Take care that your End_Date_Level is interpreted as date:
Set DateFormat = 'MM/DD/YYYY'; // Or adjust to your date format
Then this should work in your text box:
=FirstSortedValue({<Emp_ID = {"=Rank(Sum(Amount))=1"}>} Level, -End_Date_Level)
it works!
many many thanks