Hello, In a tMap, I have want to do a test if without else : field=toto?YES:<nothing> Howcan I do that ? Thank you for answers Quartz
Here is what I do to make a field hold a blank value versus a "null" value if value is a String/text: field=toto ? YES : "" Here is what I do to make a field hold a blank value versus a "null" value if value is Numeric: field=toto ? YES : 0
Thank you, Shong,
But, if the value do not change, I want to keep the value original, and if I put it in the else, there is an error.
Have you try to do that ?
Thank you for the help ...
Quartz92
Hi,
My problem is different :
In a tMap, with a test (xxx?www:ddd) I want modidy an output field with a value by testing an input field (output fiels is changed with input field or not (then, I keep original output field).
I do not see how I can do that ...
Thanh you for help,
Quartz
Hi,
ah now we're getting a bit clearer. As fair as i understand you will keep the value in your output attribute, but this value is not available in the input component you use (because it's loaded for example from another table).
So in this case you have to provide your output to the tMap as incoming stream. I would suggest the following
tInputXXX1_Check Table (row1)-->
tMap --> tOutput_Output Table (rowOutput)
tInputXXX2_Output Table (row2) -->
Now you can use the ternary operator following
rowOutput.Attribute = row1.Attribute=='someValue'?:row1.Attribute : row2.Attribute
When the if check fails, the existing value from the output component is used.
It might be helpful if you can add a screenshot of the job you modeled so far, then we can get a better understanding.
Regards,
M