Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Converting columns into rows

I have a table with the following fields

Product      India     US     UK

Fridge          123     111     10

Here, I want to convert the India,US,UK under a single column as Geography and the values as Sales.

Like

Product     Geography     Sales

Fridge          India              123    

Fridge          US                111

Fridge          UK                  10

How can this be done?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Crosstable (Geography, Sales, 3)

Load

          Product,

          Category,

          Sub-Category,

          India,

          .....

From <>;

Note : 3 is the number that signifies, first 3 fields would be loaded as it is so it is important to load Sub-Category at the beginning of your load (that is why I mentioned Sub-Category within first three rather that at the last).

View solution in original post

7 Replies
vikasmahajan

Use Cross Table Functionality

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

by using cross table only we solve these issue...

tresesco
MVP
MVP

Try like:

Crosstable( Geography, Sales, 1)

LOAD * Inline [

Product,      India,     US,     UK

Fridge,          123,     111,     10

]

Anonymous
Not applicable
Author

Hi, Can you explain the functionality using the above sample data?

Anonymous
Not applicable
Author

Hi, Thanks for that.

I'm encountering a problem in my actual data where I have something like

Product     Category     India     US     UK     Sub-Category

So, if I use Cross table here, except Product everything else will be converted to rows. How to solve this problem?

tresesco
MVP
MVP

Try like:

Crosstable (Geography, Sales, 3)

Load

          Product,

          Category,

          Sub-Category,

          India,

          .....

From <>;

Note : 3 is the number that signifies, first 3 fields would be loaded as it is so it is important to load Sub-Category at the beginning of your load (that is why I mentioned Sub-Category within first three rather that at the last).

Anonymous
Not applicable
Author

Thanks a lot tresesco‌. Time and again, you are proving that you are genius when it comes to Qlikview Thanks a lot!