Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
shanky1907
Creator II
Creator II

Order of projects in employee details

Hello All,

I have an employee database in which we are capturing previous organisation details also.

So, while taking the same, i want to order the organisations that an employee has already work upon.

1. Last Company

2.Second last company

3. Third last company

I am using the below code to give it the order:

prev_org_details_temp:

NoConcatenate

LOAD description as Prev_org_desc,

     eid,

     1 as order,

     enddate as Prev_org_end_date,     

     organisation_name as Prev_org_name,

     rid as Prev_org_role_id,

     role as Prev_org_role,

     startdate as Prev_org_Start_date

FROM

[\.....\QVD\prev_org_details.qvd]

(qvd);

prev_org_details_temp2:

NoConcatenate

load eid,

Prev_org_desc ,

Prev_org_end_date as EndDate,

Prev_org_Start_date as StartDate,

Prev_org_role_id,

Prev_org_name as PreviousOrgName,

Prev_org_role as PrevORGRole,

(num(Prev_org_end_date)-num(Prev_org_Start_date))/365 as tenure,

if(eid=peek(eid),peek(order)+1,order) as PrevOrgOrder ;

But the output only gives PrevOrgOrder =1 for the last company employee worked for. For other porevious organisations, this field is null.

Can you please help me finding the bug in the code and let me know if any mistake i am making in the concept.

Thanks in advance.

1 Reply
sunny_talwar