Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiply by -1 in Consolidation

Status
Not open for further replies.

mstrpup

Programmer
Jun 17, 2004
26
US
I am creating a consolidation and putting Revenue in one of my elements. The expression is {Account = 4600}; however I need to multiply it by a negative one because revenue is stored in the database as a negative and needs to show positve on the report. I tried putting {Account = 4600} * -1, but it errors on the negative sign. It seems to let me do math as long as I multiply/divide by positive numbers, but not negatives. Am I missing something?
 
Try putting the -1 in parentheses, like (-1). It may be throwing an error on the *-, thinking that you are putting a subtraction sign after the multiplication sign.
 
Just tried it; still gives an error...Unexpected Value '-' ... and underlines the negative sign in red.
 
It would be nice if you could use the math function Abs() to handle this detail instead of multiplying by negative 1. The assumption is that revenue itself wouldn't have a sign reversal and also have a "natural" positive value for some sort of revenue reversal.
 
Try putting the negative sign before the attribute element, like -{Account = 4600}.
 
Thanks for all the suggestions. Unfortunately none of them worked - the Abs() function is not available within a consolidation and everything else gave me that error on the negative sign.

However, I was finally able to get an answer directly from MicroStrategy so I thought I would share it here. You need to multiply the attribute element by (0 - 1). So it would be...

{Account = 4600} * (0 - 1)

Kind of odd, but it works!

Thanks again to all who tried to help!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top