Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have below table data, for each employee different Department and and position change change.
EMP_ID | DEPARTMENT | POSITION_DATE |
2001 | Accountant | 1/1/2007 |
2001 | Finance | 8/31/2014 |
2001 | IT | 6/7/2018 |
I need to consider previous position date if the selected date is not equal to postion date.
for example - If I select any other date such as 2/18/2022 then it should consider latest previous record
2001 | IT | 6/7/2018 |
And if I select 4/20/2017 then it should consider
2001 | IT | 6/7/2018 |
Kindly assist.
Regards,
Mahamed
try this in backend script:
test:
load * Inline
[
emp,dept,date
2001,accountant,1/1/2007
2001,finance,8/31/2014
2001,IT,6/7/2018
];
NoConcatenate
test2:
load *,
peek(date) as Prev_date
resident test order by date asc;
drop table test;
You will get previous record against each date when viewed in frontend table chart and will also work on selections.
Regards,
Aditya
Hi Aditya,
Thanks for the response.
Here what I am getting the same dates, instead I need its previous date.
make sure you have used 'order by'. I got below table using same solution:
Regards,
Aditya
Okay. What if I want use logic on frontend?
FYI...
dept is coming from different table and in your case you have added to inline table,
that could be the reason?