Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Peony
Creator III
Creator III

Table transpose

Hi everyone!
I have a table like this one.

Period_KeyCost ACost BCost C
2020-06-0161574152100
2020-07-011695483915000
2020-08-012083098711724
2020-09-016757120

 

And in load script I need to convert it to the table like this

Period_Key2020-06-012020-07-012020-08-012020-09-01
Cost A615716954208306757
Cost B41583998712
Cost C210015000117240

 

I am trying to use cross table but can't get proper result. 

Can any one help me to solve this task?

1 Solution

Accepted Solutions
Kushal_Chawda
MVP
MVP

@Peony  try below

Crosstab:
CrossTable([Product Key],Value)
LOAD Period_Key, 
     [Cost A], 
     [Cost B], 
     [Cost C]
FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/Table-transpose/td-p/1742510]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);

Final:
Generic load [Product Key],
             Period_Key,
             Value
Resident Crosstab;

DROP Table Crosstab; 

 

Annotation 2020-09-09 222140.png

View solution in original post

4 Replies
sunny_talwar
MVP
MVP

Peony
Creator III
Creator III
Author

Thank you Sunny foe your suggestion. Unfortunately I can't use this function because to create second table in load script I will use Resident load and Transpose() doesn't work with it.  

Kushal_Chawda
MVP
MVP

@Peony  try below

Crosstab:
CrossTable([Product Key],Value)
LOAD Period_Key, 
     [Cost A], 
     [Cost B], 
     [Cost C]
FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/Table-transpose/td-p/1742510]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);

Final:
Generic load [Product Key],
             Period_Key,
             Value
Resident Crosstab;

DROP Table Crosstab; 

 

Annotation 2020-09-09 222140.png

Peony
Creator III
Creator III
Author

@Kushal_Chawda thank you much!