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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Help needed to evaluate Boolean values in Input using tMap

Hi,
I am new to the Talend tool and currently engaged in a DataMigration project.
I have an input table with values in it. One of the columns is a BigDecimal field that contains Boolean Values (0 is FALSE, 1 is TRUE), however the column also contains NULL VALUES as no default is set. For my transformation, I am using tMap, and I wish to evaluate the value in this column as follows and based on the value, enter a String value to the column in my Output table:
For example:
---------------
If row1.TestInd = 0 then put "Not Submitted" into my Output Column
If row1.TestInd = 1 then put "Submitted" into my Output Column
If row1.TestInd = null then Do nothing
Hence I created the following Expression in tMap Expression builder but it does not work.
row1.TestInd==new BigDecimal(0)?"Not Submitted": row1.TestInd==new BigDecimal(1)?"Submitted":null
It simply sets everything to NULL in the output column when I run the job. Your help is greatly appreciated.
Regards,
Ibi
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

row1.TestInd == null ? null :
row1.TestInd.compareTo(BigDecimal.ZERO) == 0 ? "Not Submitted" :
row1.TestInd.compareTo(BigDecimal.ONE) == 0 ? "Submitted" :
null

View solution in original post

2 Replies
Anonymous
Not applicable
Author

row1.TestInd == null ? null :
row1.TestInd.compareTo(BigDecimal.ZERO) == 0 ? "Not Submitted" :
row1.TestInd.compareTo(BigDecimal.ONE) == 0 ? "Submitted" :
null
Anonymous
Not applicable
Author

Wow! Thank you so much. It worked perfectly just the way I wanted it. Appreciate your help.