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

How to make my both 2 expression display GP = 50.2% ?

Hi All

Below expression return correct GP = 50.2% :-

1-

(

sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} cost)

)

/

(

sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} sales)

)

This is because below 2 load script are working fine :-

if(@241:248T = '2',@137:151T*-1,@137:151T) as [sales],

if(@241:248T = '2',@122:135T*-1,@122:135T) as [cost],

Below return wrong GP = 49% :-

(

sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} profit_amt)

)

/

(

sum({$<year = {$(=max(year)-1)}, month = {"<=$(=max({<year={$(=max(year))}>} month))"}>} sales)

)

This is because below script is not working fine :-

if(@241:248T = '2',@137:151T*-1,@137:151T)- (@122:135T ) as profit_amt,

Hope some one can help me modify the above script, so that i can get the same GP% for above 2 expression.

Paul

12 Replies
paulyeo11
Master
Master
Author

Hi Manish

cost field 122:135T and sales field 137:151T :-

241 is the sign either +ve or -ve represent as 1 or 2

if(@241:248T = '2',@122:135T*-1,@122:135T) as [cost],

if(@241:248T = '2',@137:151T*-1,@137:151T) as [sales],
MK_QSL
MVP
MVP

if(@241:248T = '2',@137:151T*-1,@137:151T) -  if(@241:248T = '2',@122:135T*-1,@122:135T)  as Profit
paulyeo11
Master
Master
Author

Hi Manish

Now my GP% for both expression are very closed. almost correct now.

Thank you

Paul