Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;
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.
@Mahamed_Qlik do you have data as 'Jan' or like 'Jan 2021', 'Jan 2022' ?