Reputation: 13
I have a report with a list of orders and their product lines the order lines have Qty ordered, Qty Delivered and Qty Backordered.
the Group header is the Sales Order number, the Details are all the product lines on that sales order.
I want to calculate in the Report footer the count of all Sales orders that have a backorder on them only.
I can do "if sum of backorder <> 0 then 1 else 0" in Group footer, but i cannot sum the result of this, i get "This field cannot be summarized" because you cannot sum a sum.
is there another way i can achieve this?
for example:(report sample)
this example should be 1 in the report footer because only one of the orders has a backorder.
thanks
Upvotes: 0
Views: 2123
Reputation: 7527
Create a new formula with following content and name it @SalesWithBackOrder
(The formula doesn't need to be placed anywhere on the report):
If {backorder} <> 0 Then
{SalesOrderNumber}
Else
0
or if {SalesOrderNumber}
is text then:
If {backorder} <> 0 Then
{SalesOrderNumber}
Else
""
Then count the number of distinct values of the @SalesWithBackOrder
formula.
You can do this by creating a new formula with following content (put it in your report-footer):
DistinctCount ({@SalesWithBackOrder})-1 // -1 because order-number "0" respectively "" is a distinct value too.
Upvotes: 0