Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Kwame
Contributor III
Contributor III

Convert columns into rows

Greetings! all

I want to transpose the following data by converting column names to rows.

Name Date Grocery Utility miscellaneous
Thierry 12/1/2023 100 150 50
Jordan 6/5/2023 50 50 50

Resultant table

Name  Date Expenses Amount
Thierry 12/1/2023 Grocery 100
Thierry 12/1/2023 Utility 150
Thierry 12/1/2023 miscellaneous 50
Jordan 6/5/2023 Grocery 50
Jordan 6/5/2023 Utility 50
Jordan 6/5/2023 miscellaneous 50

 

Thanks a lot.

Labels (4)
3 Replies
Chanty4u
MVP
MVP

Use cross load for this caSe

 

OriginalTable:

LOAD * INLINE [

    Name, Date, Grocery, Utility, miscellaneous

    Thierry, 12/1/2023, 100, 150, 50

    Jordan, 6/5/2023, 50, 50, 50

];

TransposedTable:

CrossTable (Expense, Amount)

LOAD

    Name,

    Date,

    Grocery,

    Utility,

    miscellaneous

FROM

    OriginalTable;

DROPT ABLE OriginalTable;

Kwame
Contributor III
Contributor III
Author

@Chanty4u thanks for the response. Is there a way to filter out the highlighted within the cross table?

Kwame_0-1684953964012.png

Chanty4u
MVP
MVP

Remove date from your  cross table script

CrossTable (Expense, Amount)

LOAD

    Name,

     Grocery,

    Utility,

    miscellaneous

FROM

    OriginalTable;

DROPT ABLE OriginalTable;