0

Sum and Sort the results of a calculation

Hi there, I am challenged with sorting the results of a calculation based on two fields from a record.

My report is a Job Profit analysis by Bill-to, sorted by Profit. The Profit is calculated by the sum of, Job_Ledger_Amount.Invoice_Line - Job_Ledger_Entry.Total Cost.

The problem is that because there is no bill-to in the job ledger entry, the sorting is occurring i believe at the job no. level as I am bringing in the key as follows,

CELL E14 =NL("rows","Job",,"No.",$D$6,"Bill-to Customer No.",$D$5,"Global Dimension 1 Code",$D$3,G14,"*","Company=",$D$2,"Link=","Job Ledger Entry","Job No.","=No.","Task Code",$D$7,"Company=",$D$2,"Posting Date",$D$4)

CELL F14 =nf(E14,"Bill-to Customer No.")

CELL G14 ="-=NL(""sum"",""169"",""15"",""45"","""&$D$7&""",""64"",""Sale"",""Posting Date"","""&$D$4&""",""0"","""&$D$2&""",""job no."",NF(,""No.""))-NL(""sum"",""169"",""13"",""45"","""&$D$7&""",""64"",""Usage"",""Posting Date"","""&$D$4&""",""0"","""&$D$2&""",""job no."",NF(,""No.""))"

CELL I14 =-NL("sum","Job Ledger Entry","Total Price","Task Code",$D$7,"Entry Type","Sale","Posting Date",$D$4,"Company=",$D$2,"Job No.",NL("Filter","Job","No.","No.",$D$6,"Bill-to Customer No.",$F14))

CELL J14 =NL("sum","Job Ledger Entry","Total Cost","Task Code",$D$7,"Entry Type","Usage","Posting Date",$D$4,"Company=",$D$2,"Job No.",NL("Filter","Job","No.","No.",$D$6,"Bill-to Customer No.",$F14))

CELL K14 =I14-J14

ANY Assistance would be appreciated! THANKS IN ADVANCE!

0 comments

Please sign in to leave a comment.