Search code examples
crystal-reportssummary

How to add a conditional grand total in Crystal Reports?


I have a group running total that needs to be sum up at the report footer. Since thats not possible with CR I had to end up having another running total that refreshes "Never". But now I need to calculate some percentages at the group level based on this Grand total. Unfortunately I cannot access the value for grand total (because its another running total). Confused?? Ok reports should look like below..


    Column 1                           | Colunm 2
    ========                            ========= 

| Group 200 (Running Total Refresh at Group level) | 20% (200%1000) |
| Group 500 (Running Total Refresh at Group level) | 50% (500%1000) |
| Group 300 (Running Total Refresh at Group level) | 30% (300%1000) |


Footer 1000 (Running Total Never Refreshed)


But column 2 doesn't give me the correct value. it gives me 100% always means 200%200 or 500%500 etc.

Any idea how to fix this??


Solution

  • Thanx Lee, using a running total formula worked, I added following formula to the report footer,

    numbervar Samples; 
    if {product.sku}="card-sample" then 
       Samples := Samples + {@num_qty}; 
    
    Samples; 
    

    Then I use this formula to calculate column 2