5

I am developing a report in Crystal and I need to do a count on a particular field that has several different statuses. For example, I have a "StatusType" field in my report that contains values that are "In Process", "Rejected", "On Hold", or "Submitted". I want to be able to do a count on the "StatusType" field as to how many values are "Rejected" and "Submitted" in one formula. The report is grouped by "StatusType".

I'm new to writing formulas in Crystal Reports so would appreciate some guidance with getting a formula that will count those two values in the field. Please let me know what additional information is needed or would be helpful to assist with my question.

I do not need to display the total count for each Status Type at the start/end of each group, but would like to in the page or report header. I'm not sure which would be best. I would like to have counts of each status in one spot on the report and then be able to combine a couple of the status counts, such as the "Rejected" and "Submitted". None of the counts I want to display need to be within the body of the report or within the details but rather in the report/page header.

karthik
  • 17,453
  • 70
  • 78
  • 122
Trish
  • 93
  • 1
  • 4
  • 12
  • Do you want to display the total count for each Status Type at the start/end of each group, or elsewhere in the report? –  Jan 09 '12 at 18:47

2 Answers2

5

I think the best option here would be to use a RunningTotal rather than a formula.

Create a new Running Total and enter the following options:

  • Fields to summarize: {StatusType}
  • Type of Summary: Count
  • Evaluate: Check Use a Formula and press the formula button.
  • In the formula box enter {StatusType} = "Submitted"
  • Reset: Check Never

I don't have Crystal installed on this machine at the moment but I think that should do it. Then you can just repeat the process for the Rejected status type.

codingbadger
  • 42,678
  • 13
  • 95
  • 110
0

Assuming you want to display the count of records for each status at the end of each group, you don't need to create a formula. Simply:

  • Right-click on the status field.
  • Select Insert > Summary... from the menu.
  • Select Count as the summary type, and group: status as the summary location within the Insert Summary dialog.
  • Click OK at the bottom of the Insert Summary dialog.

This will insert a count of status in the group footer for the status group. You may want to drag it to a more convenient position and/or reformat it.

  • Thank you for your reply! Is there a way that I can show a combined total for two of the statuses that have a running total. I would like to be able to show a total of "Rejected" and "Submitted" values in the StatusType field. If I do the running totals as you indicated what would be next to get the combined total to show in the report? – Trish Jan 11 '12 at 01:55
  • @LaTrishaRoman: Barry suggested using running totals, I suggested using a Count field. In either case, it makes a difference **where** in the report you want to place this value, which is why I asked you about it in my comment on your original question. Please can you update your question to include this information, along with whether you want a count of **just** "Rejected" and "Submitted" values, or whether you want to include other values in the count too. –  Jan 11 '12 at 10:16