Counting non-zero Expressions
Posted: 16 Jul 2012, 19:24
I'm a novice to Sage Report Designer, though I'd say I'm relatively experienced with computers. My approach to Sage Reports is similar to if I were using Excel/OpenOffice Calc. And I'm using Sage 50 Accounts 2010.
I'm trying to make a report that shows how many customers buy a specific product at least once.
Although it's a very tedious and clumsy way to do it, I thought I would get a report of all transactions, grouped by customer. Then I use CountIf(AUDIT_ACCOUNT.DETAILS = [the specific product]), called Expr1. This worked fine to give a total number for each customer. I then used the same code for the total in the report footer to get a total number of times the product has been purchased by anyone. However, I thought I would be able to count the number of Expr1s that are not zero, to find the number of unique purchasers of the product, with CountIf(Expr1>0). It generates a number, generally larger than the total number of times the product has been purchased so it's clearly not right.
Can anyone help with my problem? It would be even better if someone could tell me a neater, more intelligent way to do what I'm trying to do but, considering my experience with Sage in general, this seems unlikely.
Thanks for your help and sorry for my lack of clarity.
I'm trying to make a report that shows how many customers buy a specific product at least once.
Although it's a very tedious and clumsy way to do it, I thought I would get a report of all transactions, grouped by customer. Then I use CountIf(AUDIT_ACCOUNT.DETAILS = [the specific product]), called Expr1. This worked fine to give a total number for each customer. I then used the same code for the total in the report footer to get a total number of times the product has been purchased by anyone. However, I thought I would be able to count the number of Expr1s that are not zero, to find the number of unique purchasers of the product, with CountIf(Expr1>0). It generates a number, generally larger than the total number of times the product has been purchased so it's clearly not right.
Can anyone help with my problem? It would be even better if someone could tell me a neater, more intelligent way to do what I'm trying to do but, considering my experience with Sage in general, this seems unlikely.
Thanks for your help and sorry for my lack of clarity.