Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
zebhashmi
Specialist
Specialist

I have two tables with no relation want to link them

please see the file attached.

by selecting a name from the field.  want to all related names

like if i will select a in KPI i will find c and d

and if i will select d it will show a

 

test:
load * Inline [
id, Name
1,a
2,b
3,c
4,d
];

test2:
Load * Inline [
R1,R2
1,3
1,4
2,3
]

c1.PNG

Thanks in Advance

  Its not letting me attach qvf file

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can't select a value in a field that is a different selection in the same field. Well not without some magic that requires an extension. Instead select in one field called Name and see the possible values in the field NameLink.

test:
load * Inline [
id, Name
1,a
2,b
3,c
4,d
];

mapIdName:
MAPPING LOAD id, Name Resident test;

test2:
Load
*,
ApplyMap('mapIdName',R1) as Name1,
ApplyMap('mapIdName',R2) as Name2
Inline [
R1,R2
1,3
1,4
2,3
];

test3:
LOAD R2 as id, Name1 as NameLink Resident test2;
LOAD R1 as id, Name2 as NameLink Resident test2;

 


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You can't select a value in a field that is a different selection in the same field. Well not without some magic that requires an extension. Instead select in one field called Name and see the possible values in the field NameLink.

test:
load * Inline [
id, Name
1,a
2,b
3,c
4,d
];

mapIdName:
MAPPING LOAD id, Name Resident test;

test2:
Load
*,
ApplyMap('mapIdName',R1) as Name1,
ApplyMap('mapIdName',R2) as Name2
Inline [
R1,R2
1,3
1,4
2,3
];

test3:
LOAD R2 as id, Name1 as NameLink Resident test2;
LOAD R1 as id, Name2 as NameLink Resident test2;

 


talk is cheap, supply exceeds demand
zebhashmi
Specialist
Specialist
Author

Perfect Than you very much!