Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
lawrance
Contributor II

Re: Change Rows into Column in QliKView

Thanks for all your response.

I got expected result by using my below script.

NoConcatenate

Temp:

LOAD Distinct ID,

     Status

FROM

[tab2.qvd]

(qvd) where len(ID)>0;

For i=1 to 188

NoConcatenate

Concatenate(Temp)

LOAD Distinct ID$(i) as ID,

     Status$(i)

FROM

(qvd) where len(ID)>0;

NEXT i

Thanks,

Lawrance A

MVP
MVP

Re: Change Rows into Column in QliKView

This might interest you as a much more optimized solution which is also totally flexible on how many columns the source QVD contains:

TEMP:

LOAD  

  // Get the ID from previous row if on an even numbered row.

  If( Mod(RowNo(),2) = 0 , Peek('ID'), @1 ) AS ID, 

  @1 AS Status

FROM

  tab2.qvd (qvd,filters(Transpose()); 


DATA:

NOCONCATENATE LOAD

  ID,

  Status

RESIDENT

  TEMP

WHERE

  // remove every odd numbered row since they are not necessary anymore

  Mod(RecNo(),2) = 0 AND Len(ID)>0;  

 

DROP TABLE TEMP;

MVP
MVP

Re: Change Rows into Column in QliKView

If the question has been answered please mark the right response as CORRECT and if you feel like it give all the persons that were helpful a HELPFUL tag on their responses too.

Thanks