Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ZuhaibRana
Partner - Contributor III
Partner - Contributor III

Calculate values for "End Date"

I want to calculate values for "End Date" 

"Employee ID" 1  join IT dept in jan-95

after this "Employee ID" 1 leave the IT dept and join Sales dept in dec-05 so 31-11-2015 end date of employee 1 in IT dept

like this i want to calculate all employee end date

ZuhaibRana_0-1666867325101.png

 

2 Replies
RafaelBarrios
Partner - Specialist
Partner - Specialist

Hi @ZuhaibRana 

Try this in script

load

[Employee ID],
[Dept ID],
[Dept Name],
[Start Date],
If([Employee ID]=previous([Employee ID]),previous([Start Date])) as [End Date]
from Your_table_here
Order by [Employee ID],[Start Date] desc;

You could also try

If([Employee ID]=previous([Employee ID]),peak([Start Date])) as [End Date]

it could have some syntax error as I couldn’t tried it, but I hope you get the idea.

 

hope this helps.

best,

Help users find answers! Don't forget to mark a solution that worked for you & to smash the like button! 🙂