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: 
Anonymous
Not applicable

CASE END SQL STATEMENT

Hi all,
I have the following SQL expression i would like to use in TMAP and seem to be having a little bit of trouble.
Case
When a.CT = c.Cusip THEN 'C'
When a.CF = c.Cusip THEN 'D'
End ACTIONCODE
C or D can be the output for the same field (ACTIONCODE) when either one of those conditions is met.
Does anyone have any pointers on how I can accomplish this in Talend?
Any help would be greatly appreciated!
-Chris
Labels (2)
1 Reply
Anonymous
Not applicable
Author

Hello
Does anyone have any pointers on how I can accomplish this in Talend?

Assuming your job looks like;
tMysqlInput---row1-->tMap--tLogRow
type in the expression of ACTIONCODE as:
If the data type of row1.CT, row1.Cusip, row1.CF is String, try
row1.CT.equals(row1.Cusip)?'C':(row1.CF.equals(row1.Cusip)?'D':other Value or null)

If the data type of row1.CT, row1.Cusip, row1.CF is Integer/int, try
row1.CT==row1.Cusip)?'C':(row1.CF==row1.Cusip?'D':other Value or null)

Best regards
shong