How to use below SQL case statement While using tmap component

Eight Stars RAJ
Eight Stars

How to use below SQL case statement While using tmap component

Hi Talend Folks,

                      I need to convert the below SQL case statement While using tmap component in talend

 

(SUM(case
when t1.NET < 0
then (t1.NET*-1)
else
t1.NET
end)) AS NET

Thanks
RAJ
Fifteen Stars TRF
Fifteen Stars

Re: How to use below SQL case statement While using tmap component

Hi,

Just get the absolute value of NET field:

Capture.PNG

Hope this helps.


TRF
Seven Stars med
Seven Stars

Re: How to use below SQL case statement While using tmap component

Hello,

 

You can use the tMap variables and do your query using the Talend's condition :

 

row1.myKey.equals("FirstValue")?1:0

 

In your case, you will create variable which value is t1.NET*-1 if t1.NET < 0 else t1.NET and after you will map your variable to the ouput and add the sum function to the variable.

 

Thanks,

Med

 

Thanks,

Med

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch