Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dears,
Appreciate your help.
I have a file with this data structure
AccNo Name Invoice#1 Invoice#2 Invocie#3
1 john 112345 112346
2 michael 112395 112398 112399
I want to import it and be like this (convert many columns to be one column)
AccNo Name Invoice#
1 john 112345
1 john 112346
2 michael 112395
2 michael 112398
2 michael 112399
here it is:
TAB:
LOAD * Inline [
AccNo , Name, Invoice#1, Invoice#2 , Invoice#3
1 , john , 112345, 112346,
2 , michael , 112395 , 112398 , 112399
];
FinalTab:
NoConcatenate
LOAD AccNo , Name, Invoice#1 as invoice Resident TAB;
Concatenate
LOAD AccNo , Name, Invoice#2 as invoice Resident TAB;
Concatenate
LOAD AccNo , Name, Invoice#3 as invoice Resident TAB;
DROP Table TAB;
PFA.
Hope it helps you
Regards
Nitin
CrossTable(Invoice, InvoiceNumber,2)
Load * Inline
[
AccNo, Name, Invoice#1, Invoice#2, Invoice#3
1, john, 112345, 112346,
2, michael, 112395, 112398, 112399
];
Drop Field Invoice;
you can simply use crosstable...
when you load the data, click next, Enable Transformation Step, then next and then cross table..set first two fields (AccNo., Name) as qualifiers and Give attribute a name as "Invoice"
use crosstable prefix.
crosstable(invoice#, invoice, 2)
Load * Inline
[
AccNo, Name, Invoice#1, Invoice#2, Invoice#3
1, john, 112345, 112346,
2, michael, 112395, 112398, 112399
];
it will combine all the invoice fields into one field invoice
D1:
LOAD AccNo,
[Name ],
Invoice#1,
Invoice#2,
Invoice#3
FROM
inVO.xls
(biff, embedded labels, table is [Sheet1$]);
NoConcatenate
T1:
LOAD AccNo,
[Name ],
Invoice#1 AS Invoice#
Resident D1;
Concatenate
T2:
LOAD AccNo,
[Name ],
Invoice#2 AS Invoice#
Resident D1;
Concatenate
T3:
LOAD AccNo,
[Name ],
Invoice#3 AS Invoice#
Resident D1;
RESULT LIKE THAT
Use the Crosstable prefix. Read more here: http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/24/crosstable
HIC