Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

sales by customer & rep

Hi guys,

I have two tables: sales by customer; customer and reps.

 

One customer can have multiple reps. So, when I put customer, rep, and sales in one table, I want to avg sales by customer and rep.

 

For example:

Customer Jewelry has three reps A, B, C, and a total sales of $3000.

 

I want the output to be:

Customer, Rep, Sales

Jewelry, A, $1000

Jewelry, B, $1000

Jewelry, C, $1000

 

What function should I write for Sales?

 

Thanks in advance!

1 Solution

Accepted Solutions
Almen
Creator II
Creator II

Create a new table:

 

RepCount
LOAD
Customer,
Count(Rep)		as RepCount
Resident Rep group by Customer;

 

Then:

 

Sum(Sales)/RepCount

View solution in original post

1 Reply
Almen
Creator II
Creator II

Create a new table:

 

RepCount
LOAD
Customer,
Count(Rep)		as RepCount
Resident Rep group by Customer;

 

Then:

 

Sum(Sales)/RepCount