Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

convert colum data in multiple colums

hi

i have this example table:

Account_idMod_idMod_des
10011A
10012B
10023C
10031A
10034D

and i need to transform it to something like this

Account_idABCD
10011100
10020010
10031001

How i can do this??

thanks!!

7 Replies
Employee
Employee

Re: convert colum data in multiple colums

I would suggest a pivot table... drag the 2nd dimension (Mod_des) as the column headers and use an expression formula of :  count (distinct  Mod_id)

Re: convert colum data in multiple colums

Hi Carlos, plase check attachment.

Re: convert colum data in multiple colums

In the script you could use a generic load:

Generic LOAD Account_id, Mod_des, 1

From Yoursource;

hope this helps

regards

Marco

Re: Re: convert colum data in multiple colums

like this:

QlikCommunity_Thread_143544_Pic1.JPG.jpg

Generic LOAD Account_id, Mod_des, 1

FROM [http://community.qlik.com/thread/143544] (html, codepage is 1252, embedded labels, table is @1);

hope this helps

regards

Marco

Re: convert colum data in multiple colums

Try like this

DataOrig:

Generic Load distinct Account_id, Mod_des,Mod_id;

LOAD * Inline [

Account_id,Mod_id,Mod_des

1001,1,A

1001,1,B

1002,1,C

1003,1,A

1003,1,D

];

Regards

ASHFAQ

Not applicable

Re: convert colum data in multiple colums

hi Marco,

the table box that you have in the application its the result that i need but i need it as a qvd because i have to do it another transformations.

how i can do it?

Re: convert colum data in multiple colums

To throw all those tables resulting from a GENERIC LOAD back together in order to be able to export to a QVD, see this post by Henric:

http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic

although he strongly advises against using this code.

Best,

Peter

Community Browser