Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have below two tables:
Table 1:
ID | CODE |
1 | 11AA |
1 | 12AA |
2 | 13AA |
2 | 14AA |
2 | 15AA |
Table 2:
CODE | DESC |
11AA | ENGLISH |
12AA | SPANISH |
13AA | ARABIC |
When we are connecting these table we are getting below result:
ID | CODE | CODE | DESC |
1 | 11AA | 11AA | ENGLISH |
1 | 12AA | 12AA | SPANISH |
2 | 13AA | 13AA | ARABIC |
2 | 14AA | ||
2 | 15AA |
We need below result:
ID | DESC1 | DESC2 |
1 | ENGLISH | SPANISH |
So in short we want to create multiple description filed for each ID to display as column in table object not pivot table.
Try this script
JoinTable:
LOAD
ID,
CODE,
DESC
RESIDENT Table1
LEFT JOIN
(Table2)
ON CODE;
To display the descriptions as separate columns, use calculated dimensions. Create two calculated dimensions .
For DESC1: if(rowno()=1, DESC)
For DESC2: if(rowno()=2, DESC)
we can not give rowno() as 1,2,3, becasue what if we have 10 rows.