Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

modifying QVD

Hello All,

I have a question and this might be really simple, but here goes anyway:

I have a table which is like:

ID     CO

01     A

02     A

03     A

01     B

04     B

03     C

04     C

So I want to create a QVD which will show

OriginalID     OtherID

     01               02

     01               03

     01               04

     02               01

     02               03

     03               01

     03               02

     03               04

     04               01

     04               03

So if the ID has common CO, they should represent each other in OriginalID fields.

Any ideas anyone?

Thanks

1 Solution

Accepted Solutions
Employee
Employee

Re: modifying QVD

off the top of my head:

temp1:

Load * Inline [

ID,     CO

01,     A

02,     A

03,     A

01,     B

04,     B

03,     C

04,     C

];

join Load ID as ID2, CO resident temp1;

temp2:

noconcatenate load ID as OriginalID, ID2 as OtherID resident temp1 where ID<>ID2;

store temp2 into temp2.qvd;

drop tables temp1,temp2;

2 Replies
Employee
Employee

Re: modifying QVD

off the top of my head:

temp1:

Load * Inline [

ID,     CO

01,     A

02,     A

03,     A

01,     B

04,     B

03,     C

04,     C

];

join Load ID as ID2, CO resident temp1;

temp2:

noconcatenate load ID as OriginalID, ID2 as OtherID resident temp1 where ID<>ID2;

store temp2 into temp2.qvd;

drop tables temp1,temp2;

Not applicable

Re: modifying QVD

Thanks Mr. Alejandro. I appreciate your feedback.

Community Browser