Skip to main content

I'm having a problem trying to show the data the way I need to. 

 

I have a data source of customers.  I need to calculate how many employees are needed to service those customers.  Call this field EMPLOYEES NEEDED.  The data source contains a field for customer level (CUSTOMER LEVEL) but does not have the calculation for 'employee allocation'.  So I've created a field (EMPLOYEE ALLOCATION) to give me that allocation.

 

I start to have problems because my data set has multiple records for each customer.  So to calculate the number of customers, I created a field called NUMBER OF CUSTOMERS which is just a COUNTD(Customer #). 

 

The EMPLOYEES NEEDED is a simple calculation: EMPLOYEES NEEDED = NUMBER OF CUSTOMERS * EMPLOYEE ALLOCATION

I have to wrap the EMPLOYEE ALLOCATION in an ATTR() for this to work. 

 

This causes several issues with my output:

  1. I cannot get a grand total on my EMPLOYEES NEEDED
  2. If I don't include either CUSTOMER LEVEL or EMPLOYEE ALLOCATION in the sheet, the EMPLOYEES NEEDED returns nothing. 
  3. If I try to use EMPLOYEES NEEDED in a calculation, I keep getting the 'Cannot mix aggregate and non-aggregate data' error. 

 

I'm fairly certain that I need to either change the way I'm calculating something or use a LOD to accomplish this, but nothing I've tried works. 

 

Any help is much appreciated! 

6 answers
  1. Mar 7, 2020, 2:54 AM

    Lee,

     

    Try changing the following calculations:

     

        Employee Allocation

             

              { FIXED [Customer Level]: AVG(

                  CASE [Customer Level]

                  WHEN "Level 1" THEN .5

                  WHEN "Level 2" THEN .2

                  WHEN "Level 3" THEN .075

                  WHEN "Level 4" THEN .03

                  END

              )}

     

    and

     

        Number of Customers

     

              { FIXED [Customer Level]:  COUNTD([Customer #])}

     

    Then in Employees Needed, you can remove the ATTR:

     

        Employees Needed

     

              ([Number of Customers]) * ([Employee Allocation])

     

    That should fix the issue and the table should look like the following:

     

    Lee, Try changing the following calculations: Employee Allocation { FIXED [Customer Level]: AVG( CASE [Customer Level] WHEN

     

    Attached is the workbook.  Please let me know if you have any questions.

     

    Thanks,

     

    Kevin Flerlage

0/9000