Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Combining Records

From the following script:

LOAD A,
    
C,

     D
FROM
QVDs\SOURCE1.qvd (
qvd)

 

LOAD A,
   
B
FROM
QVDs\SOURCE2.qvd (
qvd)

I get this result:

Table 1.png

I would also like to display the records in B in this way:

Table 2.png

There are differing quantities of records in B for each one in A.  Is it possible to load this in both ways?

Message was edited by: Jason Noltee

1 Solution

Accepted Solutions
Not applicable
Author

TRY THIS IS SCRIPT

LOAD A, Concat(B,'/') AS E
GROUP BY A;



Hope this helps

View solution in original post

6 Replies
Gysbert_Wassenaar

That's interesting. Since you only load field B from source2.qvd the tables will have no fields in common. So I'd expect a cartesian product instead of the result you posted. You can try creating a straight table with concat(B, ' / ') as expression for column E.


talk is cheap, supply exceeds demand
Not applicable
Author

I apologize.  I edited to show A loaded from source2 also.

Anonymous
Not applicable
Author

In this case the solution from Gysbert (concat) is correct.  You can use it on the front end or in the script.

Not applicable
Author


This is the result:

AECD
123Record 1 / Record 2 /
  Record 3 / Record 4
100200
321Record 1 / Record 2 /
  Record 3 / Record 4
200300

It should be:

AECD
123Record 1 / Record 2100200
321Record 3 / Record 4200300
Not applicable
Author

TRY THIS IS SCRIPT

LOAD A, Concat(B,'/') AS E
GROUP BY A;



Hope this helps

Not applicable
Author

Adding this worked perfectly.  Thank you.