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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Vijay_K_N
Contributor
Contributor

Fill the Previous Record value in Current Record based on Max_year

Hi,

I have scenario like this

 

s_id,year,branch

10,1,ECE

10,2,

11,3,CSE

11,4,

 

Output will be 

s_id,year,branch

10,1,ECE

10,2,ECE

11,3,CSE

11,4,CSE

 

Find the student max year id based on s_id and pass the previous branch value to the current branch

 

give me suggestions???

 

Labels (3)
6 Replies
manodwhb
Champion II
Champion II

@lli , in tmap you create a variable filed do the below way.

 

row1.branch ==null?Var.branch: row1.branch 

 

row1.branch 

Vijay_K_N
Contributor
Contributor
Author

I mean pass the branch value for maximum year of student id 

manodwhb
Champion II
Champion II

@lli , take the variable fileds for branch and s_id and do the below way .firdt sort the data on S_id ans then use tmap and implement below logic.

 

row1.S_id==Var.S_id && row1.branch ==null?Var.branch: row1.branch

Vijay_K_N
Contributor
Contributor
Author

not getting the desired output 

see the screen shots 

input:

 

s_id,year,branch
10,1,ece
10,2,null
11,3,cse
11,4,null

 

 

i want to pass the branch value if student year id is maximum

 

 


Screenshot (29).png
Screenshot (30).png
Screenshot (31).png
manodwhb
Champion II
Champion II

@lli ,can you move dow var1 and var2 after var3.

Vijay_K_N
Contributor
Contributor
Author