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: 
Not applicable

How to Convert Columns into rows in qlikview backend side ? Transpose Rotate ?

HI,

I am new to qlikview.

I really need help and suggestions for this below.

i would like to convert column  data into row.

example :

Field Key

100    1

200     2

300     3

400     4

500   5    <--this data are not fixed. this are the precalculated numbers in another table and i would like to referece those afte rbelow transpose. I have came across other people suggested Inline functionality, but, i believed, that will work if data are static.

so, can please someone suggest any solutions ?

output :

1        2          3       4       5  <--key will become columns 1 to 5 and data from field above will shows as data under each columns.

100    200    300   400   500

can someone please help me ?

Thanks!.

4 Replies
whiteline
Master II
Master II

Hi.

You could use generic load.

Just change the field order and add output row id as first column.

So that: OutputRowNo, Key, Value.

And add  'generic' before LOAD statement.

Not applicable
Author

Thanks for your reply.

I am new to qlikview.

can you please provide sample example script ?

Thanks so much.

Not applicable
Author

whiteline
Master II
Master II

In this case it's better if you start reading the reference manual.

27.1 Generic Databases

A generic database is a table in which the field names are stored as field values in one column, while the

field values are stored in a second. Generic databases are usually used for attributes of different objects.

Consider the example below. It is a generic database containing two objects, a ball and a box. Obviously

some of the attributes, like color and weight, are common to both the objects, while others, like diameter,

height length and width are not.

objectattributevalue
ball color red
ball diameter 10 cm
ball weight 100 g
box color black
box height 16 cm
box length 20 cm
box weight 500 g
box width 10 cm

since many of the attributes are not relevant for a specific object.On one hand it would be awkward to store the data in a way giving each attribute a column of its own,

On the other hand, it would look messy displaying it in a way that mixed lengths, colors and weights.

If this database is loaded into QlikView using the standard way, we get three different list boxes on the

screen.

However, if the table is loaded as a generic database, QlikView will split up column two and three into different

list boxes. QlikView will then generate one field for each unique value of the second column.

QlikView 11 SR2, 11414 379

The syntax for doing this is simple:

Example:

Generic select * from GenericTable;

It does not matter whether a load or select statement is used to load the generic database.