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

Selective Group Total

Status
Not open for further replies.

Milin

Technical User
Jan 5, 2000
33
US
Hello, <br><br>I have a report that lists meetings and their status letter, grouped by their related account.&nbsp;&nbsp;What I want to do is get a subtotal on each Account of how many Definite-status (&quot;D&quot;) leads there were per account - not a subtotal count of all meetings, JUST the &quot;D&quot; ones.&nbsp;&nbsp;I wrote this formula, which I placed in the group footer, but it doesn't work:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If {LEAD.Status Letter} = &quot;D&quot; then Count ({LEAD.Status Letter}) else 0<br><br>I bet this is an easy one??<br>Thanks<br><br>
 
Have you tried to do the add yourself ie.:<br><br>if {LEAD.Status Letter} = &quot;D&quot; then your_var = your_var + 1 else 0<br><br>Display your_var in the group footer.&nbsp;&nbsp;You will have to set your_var back to zero after printing. <p>LindaC<br><a href=mailto:lcastner@co.orange.ny.us>lcastner@co.orange.ny.us</a><br><a href= > </a><br>
 
Also, you can have running totals (which are actually various summary operations) with the type of condition you describe.&nbsp;&nbsp;They do the same sort of thing that LindaC described, but are marginally quicker to code and easier to maintain (all the relevant info about when the value is reset, etc is in one spot). <p>Malcolm Wynden<br><a href=mailto:wynden@island.dot.net>wynden@island.dot.net</a><br><a href= > </a><br>
 
Thanks for your help.&nbsp;&nbsp;I don't actually want to do a running total, as I want the count of the &quot;D&quot; value for each grouped account.&nbsp;&nbsp;I'm sorry - I am new to formulas in CR - this is what I've tried to piece together, but it doesn't work. I don't understand how to set this up. Could you walk me though this, LindaC or someone ??&nbsp;&nbsp;Thanks ;-)<br><br><br>WhilePrintingRecords;<br>numberVar Dcount;<br><br>Dcount := {LEAD.Status Letter} = &quot;D&quot;<br><br>if{LEAD.Status Letter}= &quot;D&quot; then Dcount = Dcount+ 1 else 0<br><br>
 
Actually, you can do count as a running total - not just sums.&nbsp;&nbsp;And the count can be for each group, not just a cumulative count for the whole report.&nbsp;&nbsp;The name &quot;running total&quot; is misleading.&nbsp;&nbsp;Check out the option, or you can also do through several formulas, as LindaC pointed out.&nbsp;&nbsp;It is useful to know how to do it both ways, but either will work just fine in this case. <p>Malcolm Wynden<br><a href=mailto:wynden@island.dot.net>wynden@island.dot.net</a><br><a href= > </a><br>
 
When in Crystal reports click on Insert Menu then choose Formula Field.&nbsp;&nbsp;Type a name in the next screen then click OK.&nbsp;&nbsp;This will bring up the Formula Editor.&nbsp;&nbsp;Click on the Help Files (in cr7 it is a '?').&nbsp;&nbsp;These are very helpful. <p>LindaC<br><a href=mailto:lcastner@co.orange.ny.us>lcastner@co.orange.ny.us</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top