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

Conditional Count / Sum in Cross tabs 2

Status
Not open for further replies.

boardgamer

Programmer
Feb 14, 2009
58
US
IN my report I am using the group selection expert to exclude certain groups. The problem is when I get to the report footers it sees all the records selected, including the ones excluded by the group selection expert. Can I then conditionally select which ones to count / sum in my cross tab in the report footer. [sad]
 
Instead of counting a database field, write a formula:

If <<condition>> then 1 else 0.

Insert this field into your crosstab and make it a SUM instead of a COUNT summary operation.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
My fault, I didn't tell you I wanted distict count. Can I assume there is no way to conditional count/sum in cross tabs
 
No there is usually away.

Why did you use group selection as opposed to record selection? What is your formula?

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
I want include or exclude the whole group if a certain record type is contained in that group
 
Try using conditional formulas for your crosstab fields. First create a formula {@null} by opening and closing a new formula without entering anything. Then use a formula something like this:

//{@row}:
if <group selection formula here> then
<rowfield> else
{@null} //assuming rowfield is a string

For your summary, do the same:

if <group selection formula here> then
{table.ID} else
tonumber({@null}) //assuming ID is a number

Then use a distinctcount on this new summary formula.

-LB
 
Thank you, I used a variation on the theme but it worked perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top