cancel
Showing results for 
Search instead for 
Did you mean: 

How to SUM positive values only

Former Member
0 Kudos

Hi All,

I have line item with "amount" field, i may get positive and negative values with that .

I have to SUM only positive values and that should be equals to trailer "Amount" value

How to SUM only positive values here

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Chek if there is negative sign in the value then replace the whole string with 0 and then use Sum function.

May be use can use substring function to check negative sign or you can also check with "startswith" or "endswith" function.

For example, if the string startswith '-' or endswith '-' then replace the string with 0 and then use the Sum funciton.

Former Member
0 Kudos

Hello Sarvesh / Ganesh,

Here is the mapping i was done, when i check the display Queue at SUM function, i am getting only one entry there.

Please let me know is this correct one which i did

http://img209.imageshack.us/img209/5928/mapph.jpg

Regards

Former Member
0 Kudos

You have not set the context of Amount (which is mapped to startwith function) to Highest node.

You can also perform your mapping by using the "NOT" function just after the "Startswith2" function and then in that case you don't have to use the "replacevalue" function. Make sure the context of each "Amount" field is set to highest node.

Former Member
0 Kudos

Thanks sarvesh , NOT function worked me!!!

Regards

Answers (1)

Answers (1)

Former Member
0 Kudos

Include UDF with indexof function to find

"+" or "-" . if "+" 

exists then sum up.

Regards

Ramg

Edited by: Ramkumar Ganesh on Oct 14, 2010 6:39 PM