Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahamed_Qlik
Specialist
Specialist

Cross table

Hello Guys,

I have data as below table :

ID  Product JAN FEB
A101 PRD1 200 1400 500 1100
PRD2 300 1600 600 1300
PRD3 400 1800 700 1500
B101 PRD4 800 2100 700 2500
PRD5 900 2200 - -

 

I want to display as :

ID Product Quantity Price Month
A101 PRD1 200 1400 JAN
A101 PRD1 500 1100 FEB
A101 PRD2 300 1600 JAN
A101 PRD2 600 1300 FEB
A101 PRD3 400 1800 JAN
A101 PRD3 700 1500 FEB
B101 PRD4 800 2100 JAN
B101 PRD4 700 2500 FEB
B101 PRD5 900 2200 JAN
B101 PRD5 - - FEB

 

Kindly suggest.

Labels (1)
3 Replies
Chanty4u
MVP
MVP

Try this 

Main:

LOAD * INLINE [

    ID, Product, JAN_Qty, JAN_Price, FEB_Qty, FEB_Price

    A101, PRD1, 200, 1400, 500, 1100

    PRD2, 300, 1600, 600, 1300

    PRD3, 400, 1800, 700, 1500

    B101, PRD4, 800, 2100, 700, 2500

    PRD5, 900, 2200, -, -

];

 

Crosstable(ID, Product, Month, Value)

LOAD

    ID,

    Product,

    JAN_Qty,

    JAN_Price,

    FEB_Qty,

    FEB_Price

Resident Main;

 

DROP

TABLE Main;

Mahamed_Qlik
Specialist
Specialist
Author

Hi

Thanks for response.

But this is just example and it is not only for JAN and FEB. We have the data for all the months...so I don't think to create the separate field for each month will work here.

Kushal_Chawda

@Mahamed_Qlik  do you have data as 'Jan' or like 'Jan 2021', 'Jan 2022' ?