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.
arjanijlenhave
New Contributor

Crosstable?

Hi all,

I have this:

CustomerProduct XProduct YProduct Z
123011
456100
789111

I want this?

CustomerProduct
123Y
123Z
456X
789X
789Y
789Z

Can you help me?

Regards,

Arjan

1 Solution

Accepted Solutions
sureshbaabu
Contributor III

Re: Crosstable?

Hello,

Please try the following:


CrossTable(Product, Data, 2)

LOAD Customer,

     [Product X],

     [Product Y],

     [Product Z]

FROM

Data.xlsx

(ooxml, embedded labels, table is Sheet1);

2 Replies

Re: Crosstable?

Temp:

CrossTable(Product, Value)

LOAD * INLINE [

    Customer, Product X, Product Y, Product Z

    123, 0, 1, 1

    456, 1, 0, 0

    789, 1, 1, 1

];

Result:

Load Customer, replace(Product,'Product ','') as Product

Resident Temp

where Value=1;

drop table Temp;


talk is cheap, supply exceeds demand
sureshbaabu
Contributor III

Re: Crosstable?

Hello,

Please try the following:


CrossTable(Product, Data, 2)

LOAD Customer,

     [Product X],

     [Product Y],

     [Product Z]

FROM

Data.xlsx

(ooxml, embedded labels, table is Sheet1);

Community Browser