Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i have this example table:
Account_id | Mod_id | Mod_des |
---|---|---|
1001 | 1 | A |
1001 | 2 | B |
1002 | 3 | C |
1003 | 1 | A |
1003 | 4 | D |
and i need to transform it to something like this
Account_id | A | B | C | D |
---|---|---|---|---|
1001 | 1 | 1 | 0 | 0 |
1002 | 0 | 0 | 1 | 0 |
1003 | 1 | 0 | 0 | 1 |
How i can do this??
thanks!!
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)
Hi Carlos, plase check attachment.
In the script you could use a generic load:
Generic LOAD Account_id, Mod_des, 1
From Yoursource;
hope this helps
regards
Marco
like this:
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
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
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?
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