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!

Group Count 1

Status
Not open for further replies.

AdamRicko

Technical User
Feb 19, 2009
97
GB
Hey folks,

I am currently having some trouble getting a group count. I am unsure of the best way to explain my issue, so here goes.

Product Group Last Sold Count
Customer A 1 a Y
2 a Null
3 a Y
4 a Y 0

Customer B 1 a Y
2 a Null
3 a Null
4 a Y 0

Customer C 1 a Null
2 a Null
3 a Null
4 a Null 1

Customer D 1 a Null
2 a Null
3 a Null
4 a Null 1

Subtotal = 2


Customer A 1 b Null
2 b Null
3 b Null
4 b Null 1

Customer B 1 b Null
2 b Y
3 b Null
4 b Null 0

Customer C 1 b Null
2 b Y
3 b Null
4 b Null 0

Customer D 1 b Null
2 b Y
3 b Null
4 b Null 0

Subtotal = 1


Where "Null" = never bought this product or not bought in 90days.

I am Grouping by name and by {Group is null} = if (isnull({LastSold.DeliveryDate}) or {LastSold.DeliveryDate} <= currentdate - {@Days Ago}) then 1 else 0.

So only the products that have never been bought or not bought in 90 days will show as 1 on my distinct count.


So, i only want it to count a customer if all the products in the product group are null(1).

I just seem to be going around in circles at the moment, so any help whatsoever would be greatly appreciated.

CR2009, sorry for the long winded explination, confusing myself at the mo.

Thanks in advance,

AR
 
Create a formula {@notnull}:

if isnull({table.lastsold}) then
0 else 1

Then go to report->selection formula->GROUP and enter:

sum({@notnull},{table.customer})

I am not sure what the relevance is of your DaysAgo formula. Your description is that you only want customers with null values.

-LB

 
PS. Then if you want to count the customers that are now displayed, insert a running total that does a distinct count of customer on change of group #1 (whatever that is, since customer is Group #2) and place it in the group #1 footer.

-LB
 
Cheers LB, Managed to get it sorted :)


Thanks,

AR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top