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

distinct count of boolean

Status
Not open for further replies.

Sambo8

Programmer
May 10, 2005
78
NZ
Hi All,

I'm using Crystal 8.5. My report is quite complex and has a formula that returns True or False

Its grouped by Type then by ID (in the group by id is a formula that selects the max e.g. true)

On group by Type is a distinct count of the ID. However it although they the max(false) per ID records aren't showing in the details section they are being counted in the distinct count per group by Type.

Anyone know how to get round this?

Many thanks

Sam
 
Me again - Could I solve this if I used something other than true/false?
 
Do a running total distinct counts, and use the boolian as a formula in the evaluation section.

If it returns True or False, then it is probably a Boolian, i.e. it does not start with 'If', but makes a test that is either True or False. It the formual field was called @enough, you could test it as @enough or not @enough rather than @enough=true





[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi Madawc,

Thankyou for responding, Sounds good, but won't work.

My problem is that I want to count on Group level 2(Type), but under this I have a group for ID then I want the min(boolean) per ID, because if one of the rows under that ID returns a false then the whole of that ID should be excluded from my count.

e.g

TYPE A

1 true
1 false
2 true
3 false
Type A footer 1 min = false
2 min = true
3 min = false

I would want my distinct count to return a count of 1 as only id 2 for type a is true but my count returns 3 I know why I just can't find a way around this. Any further Ideas??

Many thanks

Sam
 
Hi Madawc,

Apologies, I was trying your idea in the wrong way and now have it working.... Many thanks for your help - am very pleased.

Sam
 
I would have sorted by the boolean so that "false" was always first if present in a group and then made the evaluation formula:

(onfirstrecord or
{table.ID} <> previous({table.ID}) and
{@boolean} = true

This would ignore a true if there was also a false within the ID group.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top