'How to find percentage by group in crystal reports?

I am using crystal reports plugin in visual studio to develop crystal reports.

In my report, there are three group by functions. The hierarchy is shows below -

 Employee.EmployeeType
        Employee.EmployeeCity
           Employee.OfficeBranch
       

I need to calculate percentage of Seats occupied in every branch per city. The condition is that only those seats should be considered that have seatnumber greater than 5.

I am using the following formula but it is giving me error saying ) expected -

@seatNumber

if({Employee.SeatNumber},{Employee.OfficeBranch})>5
then
count({Employee.SeatNumber})
else
0

I know we have to use if ({key field}, {Group field}) and then we have to create another formula which we will use to sum(@seatNumber).

and then will have to use both to calculate percentage per group. But I am stuck.



Solution 1:[1]

if({Employee.SeatNumber},{Employee.OfficeBranch})>5 is not a valid expression.

You probably meant something like: if {Employee.SeatNumber} > 5

Solution 2:[2]

Since you wish to ignore seats 1-to-5 it would be a lot simpler to just add this condition to the record selection formula:

{Employee.SeatNumber} > 5

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MilletSoftware
Solution 2 MilletSoftware