
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Relational.ISNULL() fails
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)...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--------------------------
TalendDate.parseDate("MMM dd yyyy", Var.var1.substring(4,10).concat(Var.var1.substring(29, 34)))
--
Regards,
Vinod

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(If myDate is NULL then myDate = Today else myDate=myDate )
I just tested it, and it's working.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am also facing same issue. Relational.ISNULL() fails for my job.
I am using below in tmap for mapping 1 column. Still in output its showing null as result.
I just need in output, if column value is null then it should be replaced with blank else column result should be printed.
Relational.ISNULL(row8.columnValue) ? "" : (row8.columnValue + ".")
Thanks in advance.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you please double check whether the input value is null or empty string in your case?
Relational.ISNULL(row8.columnValue) ? "null value" :row8.columnValue.equals("")? "empty string": row8.columnValue + "."
Please try below code to verify your input data and let us know your results.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Input values are null in my file. I am initially loading it from csv to staging table and then putting this logic through tmap. So I can see NULL in staging data.
For now, my issue is resolved as I have putted default value as "" . Hence I am able to use your query and its working for me.
Thanks
