Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a comma separated list

Hi All,

I'm looking to perform the following task in QV:

  

ValueNew Column
AA
BA,B
CA,B,C
DA,B,C,D
EA,B,C,D,E

How can i achieve this ? I imagine there is a previous command involved. Just unsure as to how to frame the logic.

All suggestions are welcome. Thanks


V

1 Solution

Accepted Solutions
Master II
Master II

or maybe:

LOAD *,

if(Peek('New Column')<>Null(),Peek('New Column'),Null())& Value as [New Column];

LOAD * INLINE [

    Value

    A

    B

    C

    D

    E

];

View solution in original post

4 Replies

May be like this

LOAD Value,

Alt(Peek('New Column'), '') & ',' & Value as [New Column]

FROM ...

Master II
Master II

or maybe:

LOAD *,

if(Peek('New Column')<>Null(),Peek('New Column'),Null())& Value as [New Column];

LOAD * INLINE [

    Value

    A

    B

    C

    D

    E

];

View solution in original post

My intentions were right, but I should have thought through or tested my code .

Slight improvement

Table:

LOAD *,

Peek('New Column') & Value & ',' as [New Column];

LOAD * INLINE [

    Value

    A

    B

    C

    D

    E

];

FinalTable:

NoConcatenate

LOAD Value,

Left([New Column], Len([New Column]) - 1) as [New Column]

Resident Table;

DROP Table Table;

Capture.PNG

Not applicable

Thanks all.