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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Distinct Record only wanted in formula

Status
Not open for further replies.
Mar 7, 2010
61
0
0
using crystal v14 - connecting to db via orcacle db connection.

Detail section record has order #, style, colour and date and qty.
I have a formula which determines the date difference in todays
date and the field date.
I then display the information in columns based on these date differences. E.g. last 3 mths, Future 3 mths etc - Display order qty in 1st column if data diff < 90.
Now I have an overall order qty count which is a distinct count summary. However I want a distinct count of orders in these relevant data columns, E.g. Last 3 months, but because the one order could have multiple style/colour selections I cant seem to get the correct number of orders order. I have tried to display a 1 and sum this if it falls in the date criteria but where > 1 colour/style the 1 appears twice and therefore duplicates the count. I cannot work out how to distinctly count the order # where the date diff field meets the selection only. Please help!
Thanks
 
Create a formula {@null} by opening a new formula and saving it without entering anything. Then create a formula:

if {@datediff} < 90 then
{table.orderID} else
tonumber({@null})

Insert a distinctcount on this formula. If Order ID is a string, remove the tonumber().

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top