Hello,
I am trying to implement a logic within the transformer for an output column in a parallel job. This output column is producing the result like 3.24681234. I would like to see my result as 3.247. Do I use the DecimaltoDecimal function? If so, how would I write it? Is there any other way to achieve this desired result?
Thanks in advance,
Akhila.
Decimal Range
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 6
- Joined: Fri Jul 06, 2007 3:10 am
Decimal Range
Akhila Chitti
Software Engineer
HSBC, GLT.
Hyd.
Software Engineer
HSBC, GLT.
Hyd.
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
Hi Akhila -
You don't need to use a function, just specify the appropriate precision and scale in the metadata of your output link. In your case you will want a scale of 3 for your output decimal column.
John.
You don't need to use a function, just specify the appropriate precision and scale in the metadata of your output link. In your case you will want a scale of 3 for your output decimal column.
John.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
-
- Participant
- Posts: 6
- Joined: Fri Jul 06, 2007 3:10 am
-
- Participant
- Posts: 20
- Joined: Mon Dec 11, 2006 10:57 am
- Location: Pune
Akhila-
Based on the example you provided, your value should get rounded at the 3rd place. So, as John said you don't need to use DecimalToDecimal function. Specify the required length and precision. It will automatically round the decimal value.
Is there any specific reason? - just curious
Based on the example you provided, your value should get rounded at the 3rd place. So, as John said you don't need to use DecimalToDecimal function. Specify the required length and precision. It will automatically round the decimal value.
Why do need a detour if you have a straight and shortest wayAkhila: I understand that the change in the metadata range from 15,7 to 15,3 would work but then if I still need to get the output using some transformation logic or some function, then how would I be able to obtain the same?
Is there any specific reason? - just curious
Where is the 'Substring' functionMayur: This can be achieved by using Substring function.
Thanks and Regards!!
dspxlearn
dspxlearn