cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign negative values to attribute after calculation in BLS

Former Member
0 Kudos

Hi,

I am having requirement as following

result = (A*B)-C

Here A,B,C are attributes, i am getting these attributes after doing some calculation on some other attributes in Business Logic Services.

possibilities: (A*B) can be greater than C

(A*B) can be equal or less than C

I has to calculate the above result value and I has to plot in spc chart according to that by taking y-axis range as -1000 to 1000 value.

Is there any action block for this or we have to write logic.

Please can anybody help me in resolving above calculation and storing into result along with '+' or '-' sign

Message was edited by:

RAJESH PERLA

Message was edited by:

RAJESH PERLA

Message was edited by:

RAJESH PERLA

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Rajesh

I Agreed with Udayan. Though this is not clear wat exactly u want here, i think u need not get confused with (+)ve/(-)ve sign in numbers bcoz in BLS all calculations are self mathematically done with proper result.

Anyway, if it is strictly requirement of assignment for signs to numbers, u may use this expression as <b>-1 * ((A*B)-C)</b> for negative sign, otherwise <b>+1 * ((A*B)-C)</b> for positive sign.

Of course, all attributes must be Number Data Type to be calculated properly, otherwise set that attribute as number with use of built-in function <b>number(attribute)</b>

Regards

Som

0 Kudos

Actually for a positive value do not use: +1 * ((AB)-C) as this will not yield a guaranteed positive but only the sign of the ((AB)-C) expression. Instead use

abs( ((A*B)-C) )

to get the <b>absolute value</b> of the equation.

-Sam

Former Member
0 Kudos

Sam

That was not for purposely use though, i wrote just that expressions from the view-point of pure mathematics

Som

Former Member
0 Kudos

Hi Som,

After raising this thread, i worked on that equation and it is working,

i didn't check after getting the result for that equation, today i check this post and i seen answer given by you, anyway thanks a lot man, and i given points also thanks thanks

Former Member
0 Kudos

Hi Salvatore,

After raising this thread, i worked on that equation and it is working,

i didn't check after getting the result for that equation, today i check this post and i seen answer given by you, anyway thanks a lot man, and i given points also thanks thanks

Former Member
0 Kudos

I don't understand.You have your expression infront of you and and based on whatever the evaluation is, RESULT will have a -ve or a +ve value.

I am not sure what problem are you facing here.