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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
lawrance
Creator II
Creator II

Change Rows into Column in QliKView

Hi All,

Could you please help how to resolve below issue in QlikView Script?

Sample.png

Thanks,

Lawrance A

Labels (1)
12 Replies
lawrance
Creator II
Creator II
Author

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

petter
Partner - Champion III
Partner - Champion III

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;

petter
Partner - Champion III
Partner - Champion III

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