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

Crosstab counts

Status
Not open for further replies.

ShortyA

MIS
Feb 20, 2002
363
CH
Hi,
I have a report where I am currently grouping on a work date/time field. This is suppressed depending on whether the work history contains specific events or not.

I want to have a crosstab at the bottom of the report that counts the non-suppressed groups only. Currently the crosstab is counting all the date/time values whether suppressed or not.

Can anyone offer guidance ?
Thanks - Alec
 
Dear ShortyA,

You could create a formula as follows:

If {Table.Field} = (Suppression Condition) then 0 else 1

Then you could simply sum that column to get the total "Count" of non suppressed items.

Hope that helps,

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Hi Rosemary,
I have given this a whirl but the crosstab won't allow me to use that for the count section.

Unfort the crosstab functionality is pretty essential otherwise counts would have been fine.

Thanks - Alec
 
Dear ShortyA,

Please post your formula that you are trying to use in the Crosstab. I do these all the time and do not have any issues.

Just to clarify. You created the formula noted above, placed it in the details (not really necessary, but I do it) then used that same formula as a row in your crosstab and chose Summarize (Sum). Is that correct?

Ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Hi Rosemary,
the formula is:
if Global BooleanVar Hide = TRUE then 0 else 1;

I think this formula needs to be placed in the group footer for work items (the report is grouped on work date/time with the events for that item in the detail and I only want to count the workitems in the xtab).

However, when I try to create a crosstab the formula is not listed.
Alec
 
At what point do you set the value of Global BooleanVar Hide? If this is WhilePrintingRecords you generally don't have the option to do much with them as they are evaluated last. Reebo
Scotland (Going mad in the mist!)
 
Reebo,
I am running at whileprintingrecords and after another formula. That would explain why I can't see the formula.
Thanks - Alec
 
Dear ShortyA,

What condition exists that makes hide = true. I understand that you are using that to suppress, but there has to be logic that makes your booleanvar = true. Put that logic in the formula and try again.

If {table.field} = Condition then 1 else 0

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
I am going to guess from the description that the suppress is based on your 'certain events' occuring anywhere within the group. That means it is based on a group subtotal.

If your condition is based on a subtotal, you won't be able to cross-tab a formula using that condition.

Look at the other formulas that use this variable so that you can find and share with us the condition that sets it. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Dear ken,

Thanks for explaing that much better than I did....

regards,

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Ken,
you hit it straight away. So..it looks like I cannot do it.
Thanks for everyone's help.
Alec
 
Not a regular cross-tab.
if you move your condition to a group selection formula you might be able to build a fake cross-tab using a running total for every cell. Problem is that it won't be dynamic. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top