Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting by a Running total, yet again!

Status
Not open for further replies.

aaronburro

Programmer
Jan 2, 2003
158
US
Welp, I got another quandry that is getting to me. As the title sounds, I need to sort, effectively, on a running total.

Here's how it works:
Customer
Product Line
Invoice Number
Details

Invoices are selected for the groups via a group selection formula (which is based on a summary, thus the reason I have to resort to group selection). Because of this, running totals are used for the product line and customer summaries.

I need to be able to sort customers by one of the running totals. Can I accomplish this?

I am using CR8.5 and MAS200 v4.00
 
You can't sort by running totals. What is your group selection formula? You could potentially eliminate this by using a SQL expression in your record selection formula. You could then sort by inserted summaries.

-LB
 
well, here is the group selection formula. It aint pretty, but it gets the job done :D However, I'm not entirely sure that I can use SQL expressions w/ MAS200 v4.00, so...

// we only want to include Invoices in our group that satisfy any LTL requirements
// requirements:
// 1) definitely an LTL carrier
// 2) if the fuel surcharge is a delivery pallet rate, then its an LTL
// 3) if the weight is greter than half a truckload, then its not an LTL
// 4) if the number of pallets is greater than the defined maxPallets, then its not an LTL
// 5) if the invoice contains bulk product, then it is not LTL
Global NumberVar LTLWeight;
Global NumberVar LTLPallet;

BooleanVar case1 := (Sum ({@Is Bulk}, {ARN_InvHistoryHeader.InvoiceNumber}) > 0); // it is bulk
BooleanVar case2 := {@Is LTL Carrier}; // it is LTL only carrier
BooleanVar case3 := (SUM({@Item Pallet Delivery Rate}, {ARN_InvHistoryHeader.InvoiceNumber}) > 0); // has pallet delivery rate
BooleanVar case4 := NOT(Sum ({@Item Num Pallets}, {ARN_InvHistoryHeader.InvoiceNumber}) > LTLPallet); // # pallets within limit
BooleanVar case5 := NOT(Sum ({@Item Weight}, {ARN_InvHistoryHeader.InvoiceNumber}) > LTLWeight); // weight within limit

//!1 & (2 || 3 || (4 & 5))
(NOT(case1)) AND (case2 OR case3 OR (case4 AND case5))
 
Sorry, I can't see a way of doing a sort. Basically, you have to be able to insert a summary in order to do a group sort. Maybe someone else will have a suggestion.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top