Hey, i want to check the content of Field in a tmap, used as a counter... If the return of the row is null (=does not exist), i want to set the value 0 for the new row (=INSERT of ROW). If the the return of the row has a content (>=0), I want to increase the value with 1 (=TIMES of UPDATE) Field definition: BigDecimal(22,0) the formula should look like this: Relational.ISNULL(row6.COUNTING)?0:row6.COUNTING+1 But i get an error in the Test-tool of the Expression Builder, regardless of the used Test-value: Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The same with a Date: Like: IF the DATEFIELD IS NULL then gimme sysdate else use DATEFILED Relational.ISNULL(row6.DATEFIELD)?TalendDate.getCurrentDate():row6.DATEFILED
What is wrong with the two statements? Please help (I am new in Java, only DB-Developer)...
Hi, You can use following expression to increment your count. row1.COUNTING == null || row1.COUNTING == 0 ? 0 : row1.COUNTING + 1 Please provide us the date format sample, and the information that whether the date is contained in "String" or "Date" Field. -- Regards, Vinod
Hi, Ideally expression row1.DATEFILED == null ? TalendDate.getCurrentDate() : DATEFILED should work, however at my end it is not able to parse any provided date in any format using tFixedFlowInput/tFileInputDelimited component, try same with your job, but if it does not work you can make use of the below mentioned expression row1.DATEFILEDisEmpty() || row1.DATEFILED.toString() == null ? TalendDate.getCurrentDate().toString() : DATEFILED Later returned string can be parsed to retrieve Date, using tExtractRegexFields or tConvertType. -- Regards, Vinod
I'm using Talend 5.4.2 and I'm facing the same issue that mpmarky had faced. I understand the alternative way that vinod_talend has provided but I want to know how to use Relational.ISNULL() function for the task that mpmarky tried to do. Is there anyone from the Talend product team that can help us with this ?