3 Replies Latest reply: Apr 13, 2016 6:33 AM by Yeo Poh sai

# How can i avoid using  if(fabs(column(1))=0,1,column(2) / fabs(column(1))-1) ?

Hi All

I have a Target table , it have a column "Diff1" when i use :-

if(fabs(column(1))=0,1,column(2) / fabs(column(1))-1)

it return correct % .

If i use below expression :-

(
Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1/1000)
-
Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/1/1000)
)
/
(Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1/1000))

iot return wrong only on G1 Row. it give 95% it should be 49%.

May i know how to make both same ?

Paul

my qvf

• ###### Re: How can i avoid using  if(fabs(column(1))=0,1,column(2) / fabs(column(1))-1) ?

I think the two expressions are totally different. See if this is what you wanted:

If(Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/1/1000) = 0, 1,

Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}sales/1/1000)

/

fabs(Sum({\$<year = {\$(=Max(year)-0)}, month = {"<=\$(=Max({<year={\$(=Max(year))}, sales = {'*'}>} month))"}>}sales_target/1/1000)) - 1)

• ###### Re: How can i avoid using  if(fabs(column(1))=0,1,column(2) / fabs(column(1))-1) ?

Hi Sunny

you are good, thank !

Paul