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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
himabinduch
Creator
Creator

Peek Function

Hi,

I have data as below

Employee:

load * Inline [

Employee, Address, EmployeeCode

z,xxe,7

A , XXX, 1

B , YYY, 2

C ,ZZZ, 3

D, QBC, 100

E, LAD, 200

M,WWW,5

];

table:

Load

Employee,

Address,

EmployeeCode,

IF(MATCH(Employee, 'A','B','C','D','E','M'),PEEK(EmployeeCode,0),EmployeeCode) as Val2

Resident Employee;

drop table Employee;

if i add any record in the first line of inline it should not reflect to the  column Val2

for example if i add one record says y in the first line of inline still it should shows employee code as 7 in val2  field how can i write expression for this.


please help me on this


thanks,

himabindu ch

Labels (1)
3 Replies
sunny_talwar
MVP
MVP

What about the expected output for A, B, C, D, E, M employee? Why are they getting Val2 from the row above?

himabinduch
Creator
Creator
Author

Hi Sunny,

i want employee code of A, B, C, D, E, M is as employee code of  Z.


and in above Val2 column is representing the same but if i changed the order then PEEK function will take the order accordingly.i don't want that to happen it should be constant if i changed the order.

antoniotiman
Master III
Master III

Try this

IF(MATCH(Employee, 'A','B','C','D','E','M'),Lookup('EmployeeCode','Employee','z','Employee'),EmployeeCode) as Val2

Regards,

Antonio