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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert column values to rows based on another column

Hi,

I have just started working on Qlikview scripting where I need to convert a single column to rows based on another column.

Input:

Capture.PNG

Here, i need to convert Value column into Rows based on Rowno

Output:

     Capture.PNG

Can anyone help me on this?

Thanks

Praveena

1 Solution

Accepted Solutions
MarcoWedel

Hi,

one solution could be:

QlikCommunity_Thread_313635_Pic1.JPG

table1:

Generic

LOAD Rowno,

    'Col'&AutoNumber(RowNo(),Rowno),

    Value

Inline [

    Value, Rowno

    /          , 1

    2          , 1

    20180821   , 1

    /          , 2

    4          , 2

    20180822   , 2

    /Collection, 3

    8          , 3

    20180821   , 3

];

see also:

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptPrefixes...

hope this helps

regards

Marco

View solution in original post

3 Replies
Frank_Hartmann
Master II
Master II

Script:

LOAD * INLINE [

    Value, Rowno

    /, 1

    2, 1

    20180821, 1

    /, 2

    4, 2

    20180822, 2

    /Collection, 3

    8, 3

    20180821, 3

];

Straight Table:

Dim:

Rowno

Expression1 (Label=col1):

subfield(Concat(Value,',',Value),',',3)

Expression2 (Label=col2):

subfield(Concat(Value,',',Value),',',1)

Expression3 (Label=col3):

subfield(Concat(Value,',',Value),',',2)

On Presentation Tab you can hide Dimension

Output:

Unbenannt.png

MarcoWedel

Hi,

one solution could be:

QlikCommunity_Thread_313635_Pic1.JPG

table1:

Generic

LOAD Rowno,

    'Col'&AutoNumber(RowNo(),Rowno),

    Value

Inline [

    Value, Rowno

    /          , 1

    2          , 1

    20180821   , 1

    /          , 2

    4          , 2

    20180822   , 2

    /Collection, 3

    8          , 3

    20180821   , 3

];

see also:

https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/ScriptPrefixes...

hope this helps

regards

Marco

Anonymous
Not applicable
Author

Thankyou Marco

It worked.