Quantcast
Channel: AX Developer Forum
Viewing all articles
Browse latest Browse all 9880

Margin and Margin% columns in report design

$
0
0

Hello all,

I have two custom columns, margin and margin% in my report

Margin=(unitprice-unit cost+inv.discount Amount+special price)

Margin%=(Grossmargin/unit price)*100

margin column is working fine but margin% columns is not getting the correct result, it is showing all zeros..
i have used below c/al code :

IF ("Sales Line"."Unit Price" <> 0) THEN

  GM := ("Gross Margin" /("Sales Line"."Unit Price") *100

ELSE

  GM := 0; 

I have defined variables,Gross margin and GM% in  c/al globals.i have tested abv c/al code

Only division operation is not working in the code, but i had tested with other operators like +, - ...its getting result. Please can any one help me on this. Eagerly waiting for your valuable solutions.......

Thanks in Advance


Viewing all articles
Browse latest Browse all 9880

Trending Articles