Rounding From Decimal to Integer In PX
Moderators: chulett, rschirm, roy
Rounding From Decimal to Integer In PX
I have a decimal value ie 3763.8 and I want to convert to an Integer with Rounding to the next number. Therefore the expected integer value I should get is 3764. Likewise if my decimal value is 2314.2, the integer value I should get is 2314.
I have looked through the various postings but I didn't find anything that seem to work. Currently I am using AsInteger(Link.ColName)
Please let me know..
Thanks
dtatem
I have looked through the various postings but I didn't find anything that seem to work. Currently I am using AsInteger(Link.ColName)
Please let me know..
Thanks
dtatem
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
If you map your decimal directly to an integer field of the same length rounding should happen implicitly the way you want.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Did you try? I'm not getting any warning in my jobs ![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
You could use message handlers to suppress or demote warning messages. More information can be found in chapter 6 of the Director guide or search the forum for discussions on the same.dtatem wrote:how do I suppress the warning message?
Thanks..
dtatem
Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
That's not the same as not generating the warnings in the first place!
When you use the Modify stage add an additional specification containing the single word NOWARN.
This is not in the Parallel Job Developer's Guide but you can find it in the Orchestrate Operators manual.
When you use the Modify stage add an additional specification containing the single word NOWARN.
This is not in the Parallel Job Developer's Guide but you can find it in the Orchestrate Operators manual.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
JoshGeorge:
I haven't tried it as yet. To give you more information,the decimal values I posted earlier,are derived from an input declared as Dec(10,2). The input dec(10,2) are passed into the aggregate stage. The "Sum Output Column" data type is defaulting to "DOUBLE", I then use a transformer to cast the result from DOUBLE to Integer.. ie AsInteger(Link.Colname).
Should I make the data type length to Integer(10)?
--dtatem
I haven't tried it as yet. To give you more information,the decimal values I posted earlier,are derived from an input declared as Dec(10,2). The input dec(10,2) are passed into the aggregate stage. The "Sum Output Column" data type is defaulting to "DOUBLE", I then use a transformer to cast the result from DOUBLE to Integer.. ie AsInteger(Link.Colname).
Should I make the data type length to Integer(10)?
--dtatem
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 612
- Joined: Thu May 03, 2007 4:59 am
- Location: Melbourne
Output type of calculation column is normally double, but you can default (override) this to decimal in the aggregator. You can see this option in the properties - Available properties to add. Now as noted earlier in the transformer you can map your decimal directly to an integer field of the same length. You shouldn't get any error/ warning messages for this.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>