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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
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! 🙂