Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Reverse crosstable table

Hi All,

I have 2 table like below

TableA:

Country,Value:

A1,12

A2,23,

A3,34

TableB:

Country,Value:

B1,122

B2,232

B3,342

and I want to create a table like

FinalTable:

KEY,CountryA,CountryB

1,A1,B1

2,A1,B2

3,A1,B3

4,A2,B1

5,A2,B2

6,A2,B3

7,A3,B1

8,A3,B2

9,A3,B3

Whats the easiest way to do that inside the script??

Tags (1)
2 Replies
MVP
MVP

Re: Make horizontal table

TableA:

Load * Inline

[

Country,Value

A1,12

A2,23,

A3,34

];

NoConcatenate

TableB:

Load * Inline

[

Country,Value

B1,122

B2,232

B3,342

];

Load Distinct Country as CountryA Resident TableA;

Join

Load Distinct Country as CountryB Resident TableB;

Drop Tables TableA, TableB;

Not applicable

Re: Make horizontal table

TableA:

LOAD * INLINE [

CountryA,ValueA

A1,12

A2,23

A3,34 ];

TableB:

LOAD * INLINE [

CountryB,ValueB

B1,122

B2,232

B3,342 ];

OUTER JOIN (TableA)

LOAD *

RESIDENT TableB;

DROP TABLE TableB;

  FinalTable:

  LOAD

  RowNo() as Key,

  CountryA,

  CountryB

  RESIDENT TableA;

  DROP TABLE TableA;

exit script;

Community Browser