Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Expression is giving me the wrong results

Hi Guys,

I've got a calculation in EXCEL that is -14867/-3245 that gives me a result of 458.1%.

But when I do the same calculation in QS, I'm getting something completely different.64239357%

Here's the expression


ceil(sum({<[SALES MONTH]={'$(vMonthPrevious5)','$(vMonthPrevious3)','$(vMonthPrevious4)'}
,NEW_PRODUCT_FAMILY_DESC={"AAA"}>}[AAA Value PQ]),5)/1000

-

ceil(sum({<[SALES MONTH]={'$(vMonthPrevious6)','$(vMonthPrevious7)','$(vMonthPrevious8)'}
,NEW_PRODUCT_FAMILY_DESC={"AAA"}>}[AAA Value PQ]),5)/1000

/

ceil(sum({<[SALES MONTH]={'$(vMonthPrevious5)','$(vMonthPrevious3)','$(vMonthPrevious4)'}
,NEW_PRODUCT_FAMILY_DESC={"AAA"}>}[AAA Value PQ]),5)/1000

+
ceil(sum({<[SALES MONTH]={'$(vMonthPrevious5)','$(vMonthPrevious3)','$(vMonthPrevious4)'}
,NEW_PRODUCT_FAMILY_DESC={"BBB"}>}[BBB Value PQ]),5)/1000

-

ceil(sum({<[SALES MONTH]={'$(vMonthPrevious6)','$(vMonthPrevious7)','$(vMonthPrevious8)'}
,NEW_PRODUCT_FAMILY_DESC={"AAA"}>}[AAA Value PQ]),5)/1000

+

ceil(sum({<[SALES MONTH]={'$(vMonthPrevious6)','$(vMonthPrevious7)','$(vMonthPrevious8)'}
,NEW_PRODUCT_FAMILY_DESC={"BBB"}>}[BBB Value PQ]),5)/1000

Thanks in advance

11 Replies
Anonymous
Not applicable
Author

Exactly, that's why it was driving me crazy lol.

swuehl
MVP
MVP

Sunny T wrote:

What is the order of things here: Is it

(A-B)/(A + C - B + D)

or is it this?

(A-B)/((A+C) - (B+D))

Assuming each letter corresponds to your each Ceil() expression

Seems like an associative data model breaks associative laws