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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

Normalize csv file : from rows to columns

Hello,
I have a complicated thing to do with Talend..
My input is a csv file. Here is its schema :
Id_shop;Id_cust;Id_prod;Year;Month;day1;day2;day3;...;day30;
The fields "day1" to "day30" contain quantities. The quantities of products ("Id_prod") sold by a shop ("Id_Shop") to a customer ("Id_cust") at the date "Month/Year". The field "day1" contains the quantity of the first day of the month and "day30" the quantity of the last day.
I would like to load those data in a oracle table which has this schema :
Id_shop;Id_cust;Id_prod;Date;Quantity
No problem for the Id_shop, Id_cust and Id_prod (it's the primary key) but the field Date is defined by the month, the year and the days from the csv file.
For example :
in the csv file : month = 05 and year = 2008.
in the oracle table, i should have for each key all dates from 01/05/2008 to 30/05/2008
Then, for the date 01/05/2008 the field Quantity contains the quantity written in the field "day1" of the csv file.
Is that clear?
With informatica, there is a module called normalizer which allows to do that.. Is there something equivalent in Talend?
Thanks!
Nico
Labels (2)
14 Replies
Anonymous
Not applicable

Your question is very clear, have a look at 4500
Anonymous
Not applicable

I hv tried devloping a job with details provided in the link above, but ended up with the error.
please help me out. i hv attached the error image.
vin
youssef2
Contributor
Contributor

Hi,
I think you should use row2 in tjavarow. So the code in tJavaRow becomes :
globalMap.put("AMT1",row2.AMT1);
globalMap.put("AMT2",row2.AMT2);
globalMap.put("AMT3",row2.AMT3);
Regards,
Youssef
Anonymous
Not applicable

thnks youssef
vin
youssef2
Contributor
Contributor

you wrote
gloablMap.put("AMT3",row2.AMT3);
instead of
globalMap.put("AMT3",row2.AMT3);

Regards,
Youssef
Anonymous
Not applicable

I hv corrected them, the job was showing no errors with no output.
the problem is input values are processed only to tJavarow, but not to tForeach and subsequent components.
did i leave anything not mentioned
vin
youssef2
Contributor
Contributor

hi,
did you fill the tree enteries in tForeach Componenent as shown in 17745
Regards youssef
Anonymous
Not applicable

Thanks Yousef,
I have got it. Its working fine
Vin
Anonymous
Not applicable

90
I've chosen to have a hard coded schema as tUnpivotRow output, it makes things a lot easier to configure for user. Use tExtractDelimitedFields to extract subfields in the output "row_key" column.