Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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

Re: Combining Records

TRY THIS IS SCRIPT

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



Hope this helps

6 Replies
MVP & Luminary
MVP & Luminary

Re: Combining Records

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

Re: Combining Records

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

mov
Esteemed Contributor III

Re: Combining Records

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

Not applicable

Re: Combining Records


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

Re: Combining Records

TRY THIS IS SCRIPT

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



Hope this helps

Not applicable

Re: Combining Records

Adding this worked perfectly.  Thank you.

Community Browser