Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rmuhammad
Creator
Creator

Check value in 3rd table in load script how?

Hi

I have a situation were I have table A & B loaded into memory, when I loading Table c I need to mask a value based on value from table A how do I do this? is lookup() or peek() would help

see image

Load script.PNG

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

What is your expected output in table C.?

Are you looking for something like this?

Try:

TableA:

Mapping LOAD GroupID, Dept INLINE [

GroupID, Dept, DeptDesc

10, 500, abc

11, 501, bbc

12, 502, cba

13, 563, aaa

14, 555, cab

15, 878, bbb

];

TableB:

LOAD *, ApplyMap('TableA', GroupID) AS ColorDept INLINE [

EmpID, GroupID

9595, 12

9999, 12

9000, 13

9990, 10

9001, 15

8999, 11

];

Capture.PNG

Used a background color expression to get the respective colors, you can change accordingly.

View solution in original post

6 Replies
sunny_talwar

rmuhammad
Creator
Creator
Author

Mapping load require a key, Table A & C have no common key.

sunny_talwar

Group ID seems to be the same, no? Based on Group ID, you want to determine if Dept is 500 or 501 and then based on that you decide color

rmuhammad
Creator
Creator
Author

Yes but Table C has Empl ID no Group ID and I am trying to do in the load script for the Table C

vishsaggi
Champion III
Champion III

What is your expected output in table C.?

Are you looking for something like this?

Try:

TableA:

Mapping LOAD GroupID, Dept INLINE [

GroupID, Dept, DeptDesc

10, 500, abc

11, 501, bbc

12, 502, cba

13, 563, aaa

14, 555, cab

15, 878, bbb

];

TableB:

LOAD *, ApplyMap('TableA', GroupID) AS ColorDept INLINE [

EmpID, GroupID

9595, 12

9999, 12

9000, 13

9990, 10

9001, 15

8999, 11

];

Capture.PNG

Used a background color expression to get the respective colors, you can change accordingly.

rmuhammad
Creator
Creator
Author

Thanks for the help

along the same lines I applied map created new temp field and after loading table C using if condition resolved my issue. at the end dropped the temp field