How to compare two values to hold back one and insert it

Highlighted
Five Stars

How to compare two values to hold back one and insert it

Hi all, 

I have some problem, i want find your support please.

I have a source table "Medicament " and a target table "dim_medicament".

in Medicament i have two variables "PrixUnitaire" and "EtatMed

PrixUnitaire is an float

and EtatMed is an integer (who take the 1 if medicament it's available and 0 if isn't)

In the target table , i want add a "Prix" variable who receive the "PrixUnitaire" if the medicament is available and 0 if isn't.

for dim_medicament.Prix i wrote this expression , and i found a some mistakes:

 (Medicament.EtatMed = 1) ? (Prix = Medicament.PrixUnitaire) : (Prix = 0) 

I ask your help above.

Thank you

 


Accepted Solutions
Eight Stars

Re: How to compare two values to hold back one and insert it

Hello,

 

What about something like this?

 

 

Capture.JPG


All Replies
Eight Stars

Re: How to compare two values to hold back one and insert it

Hello,

 

What about something like this?

 

 

Capture.JPG

Five Stars

Re: How to compare two values to hold back one and insert it

Thank you
my problem is resolved

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

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now