Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I want to produce an etl process for sales. I have Input asc file with Informations, one of them must be calculated. In Pentaho we had used the Calculator for it, I think in Talend Studio the right transformer is tjavarow. In the asc. file date is in this form (string) 19990816. With this Information I want to calculate quarter, month and year. After this procedure I Need a combination lookup and at last the Information should be written in an Oracle table. Is all them possible in Talend Studio. I'm trying since days and reading in different Forums, but don't find any Option.
Thank you.
Hi
In Talend, call the built-in functions on tJavaRow or tMap to calculate the parts of year, for example:
tfileInputDeliimited--row1--tMap1--out1--tMap2--out2--tMap3----
|
lookup
|
tOracleInput
on tMap1: parse the string to a Date with built-in function TalendDate.parseDate("yyyyMMdd", row1.dateColumn)
on tMap2: get parts of year
quarter: TalendDate.getPartOfDate("MONTH", out1.dateColumn)/3+1
month: TalendDate.getPartOfDate("MONTH", out1.dateColumn)
year: TalendDate.getPartOfDate("YEAR", out1.dateColumn)
Regards
Shong
Hi
In Talend, call the built-in functions on tJavaRow or tMap to calculate the parts of year, for example:
tfileInputDeliimited--row1--tMap1--out1--tMap2--out2--tMap3----
|
lookup
|
tOracleInput
on tMap1: parse the string to a Date with built-in function TalendDate.parseDate("yyyyMMdd", row1.dateColumn)
on tMap2: get parts of year
quarter: TalendDate.getPartOfDate("MONTH", out1.dateColumn)/3+1
month: TalendDate.getPartOfDate("MONTH", out1.dateColumn)
year: TalendDate.getPartOfDate("YEAR", out1.dateColumn)
Regards
Shong
Hello Shong,
you mean that is possible even though I have two different tables in my database? I have in Pentaho a calculator in which I have calculated the quarter, month and year The key for is is from table2 my primary key (salesdate). I make a combine lookup to merge the values generated from table1 (date) (primary key is technical_key) with table2 (sales) (Primary key ist salesdate). The last step ist writing the information in table2 (sales).
tmap is enogh for all of this?
thank you for your rapidly answer,
best regards,
Seher
Thank you, I will read it and hope it will be easy to make the calculation. But I need tOracleTableOutput and not Input or didn't I read the tooltips false. I want to write the information back to my Table in Database. Thank you very much.
Sorry, I understand now, why it should be Input.
Sorry I have another question because of this, my java debugger doesn't start so I can't look myself
I have added
TfileInputDelimited (Sales.csv) - row1 - tMap1 - out1 - tMap2 - out2 - tLogRow1
I
I row2(lookup)
TOracleInput1
I think my OracleInput1 is my Date Table and I want make a lookup between them.
In tMap1 I have this TalendDate.parseDate("yyyyMMdd", row1.Bestellnummer) and it doesn't fail.
I have in row2 of tMap2 the expression for quarter, month and year, you have written in your message. In tMap2 I get this error Job compile errors
At least job "Umsatz_test" has a compile errors, please fix and export again.
Error Line: 1720
Detail Message: Type mismatch: cannot convert from int to String
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio..
How can I fix it without a debugger?
Verify the schema data types of the columns containing the quarter, month and year expressions in your tMap2.
Hello cterenzi,
I've add after every step a tLog and could see the output. It was easier to fix. Thanks for your help.