Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

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

1 Solution

Accepted Solutions
sunny_talwar

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)

View solution in original post

3 Replies
paulyeo11
Master
Master
Author

my qvf

sunny_talwar

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)

paulyeo11
Master
Master
Author

Hi Sunny

you are good, thank !

Paul