Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rows to Columns dynamically without Cross Table

Dear Experts,

I would like to develop a script which converts the rows into columns dynamically

Since the data is huge the Cross Table is not the optimized way and the Customer don't want the same thing in the layout by Pivot.

Attaching a sample data and the kind of output needed for your kind reference.

Kindly help

Thanks & Regards

Jeba

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

This should give you an idea of how to do pivot in script dynamically:

2015-09-23 #1.png

View solution in original post

10 Replies
alexandros17
Partner - Champion III
Partner - Champion III

You could use Left Join un the table filtered by the row value you need as column ....

jonathandienst
Partner - Champion III
Partner - Champion III

Jebamalai Dass wrote:

Since the data is huge the Cross Table is not the optimized way

Have you tested this assertion? The cross table operation converts the data into a proper fact table that will perform better than the original cross table and will greatly simplify the dimensions and expressions in the front end.

While you could achieve this manually, I very much doubt that what you do will outperform the QV crosstable function.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi Alessandro,

All the fields are in the same qvd.

Does this mean we need to load twice and left join?

Regards

Jeba

Anonymous
Not applicable
Author

Hi Jonathan,

Thanks for the guidance,

I tried that but it took huge time and was not responding

Thanks & Regards

Jeba

alexandros17
Partner - Champion III
Partner - Champion III

Not twice but as many times as the different values you need as column (you can use a loop after you tested for a column)

Anonymous
Not applicable
Author

Hi Alessandro,

Is there any examples you can share with me?

Regards

Jeba

marcus_sommer

I think jontydkpi is right. In addition to them it might be helpful to split the crosstable-loadings in cases that there isn't enough RAM (it shouldn't be swapped into the virtual RAM) and/or to use incremental loads. Here you find various links to them: Advanced topics for creating a qlik datamodel

- Marcus

jonathandienst
Partner - Champion III
Partner - Champion III

You probably ran out of memory - what makes you think that you can do it using less memory? This is a function of your data set and server RAM. You may have to reduce the one or increase the other.

But perhaps you should post the code that your tried. Please include the field names (ie not LOAD *) for diagnostic purposes.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Hi Jonathan,

I will try another time

May be a issue in the cross table logic I used

Thanks for your time

Regards

Jeba