Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Champion III
Champion III

Re: Check value in 3rd table in load script how?

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
Highlighted

Re: Check value in 3rd table in load script how?

Highlighted
Creator
Creator

Re: Check value in 3rd table in load script how?

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

Highlighted

Re: Check value in 3rd table in load script how?

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

Highlighted
Creator
Creator

Re: Check value in 3rd table in load script how?

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

Highlighted
Champion III
Champion III

Re: Check value in 3rd table in load script how?

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

Highlighted
Creator
Creator

Re: Check value in 3rd table in load script how?

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