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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
RAJ6
Contributor III
Contributor III

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

Labels (2)
2 Replies
TRF
Champion II
Champion II

Hi,

Just get the absolute value of NET field:

0683p000009Lvna.png

Hope this helps.

med1
Creator
Creator

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