Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count number clients assigned to salesperson

Hello, i have a dinamic table where i have to show the total number clients assigned to salesperson, i have this information in table clients.

I am using this expression but the result is not correct

Aggr(Count (DISTINCT %CodCliente),%CodVendedor)

9 Replies
MarcoWedel

Dimension:

%CodVendedor


Expression:

Count (DISTINCT %CodCliente)


is not working?

Not applicable
Author

This expression has customers which the seller sold them, i need to count the clients that the seller has assigned and  which appear in customers tables, for examples in table customers

Client          Salesperson

A                       Carlos

B                       Luis
C                       Maria

D                       Carlos

E                       Carlos

F                        Carlos

G                       Luis

H                       Maria

I should have:

SalesPerson               #Clients

Carlos                         4

Luis                             2

Maria                           2

I am doing a query and work, but i don´t know my mistake in qlik

select CodigoVendededor,count(CodigoCliente) from clientes group by CodigoVendedor

Anil_Babu_Samineni

In expression, where you have signed sales person?

I agree marco suggestion simply

You can try this to

Aggr(Count ({<salesperson>} DISTINCT %CodCliente),%CodVendedor)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Hello Anil, thanks for your reply, but i don´t select the sales person, i need to count total clients assigned to salesperson

Anil_Babu_Samineni

Try with simple

Dimension as sales person

Expression is count(client)

Or

Count(total client)

This should be straight table or pivot table

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi Elina,

May be like this

See below script and attached file

Data:

LOAD Count(Client) as Client ,

  Salesperson

INLINE [

 

    Client  ,  Salesperson

    A      ,  Carlos

    B      ,    Luis

    C      ,    Maria

    D      ,    Carlos

    E      ,    Carlos

    F      ,    Carlos

    G      ,  Luis

    H        ,  Maria

] Group By Salesperson;

I hope this helps you.....

-Nagarjun

neelamsaroha157
Specialist II
Specialist II

Are you looking for this??

If yes then, I think it needs simple Count of client with SalesPerson as dimension

Capture3.PNG

Not applicable
Author

Thanks, for yours reply, i can to resolve this issue

In my ETL  in clients table i am using AutoNumber(RowNo(),VendedorCliente) as Num,

And in my application with Dimension Salesman and expression Aggr(Max(Num),VendedorCliente)

Not applicable
Author

Hello, i have a little problem, now i need to show the names of clients, i am using a script like post for

nagarjuna k , please you can help me

Data:

LOAD Count(Client) as Client ,

  Salesperson

INLINE [

 

    Client  ,  Salesperson

    A      ,  Carlos

    B      ,    Luis

    C      ,    Maria

    D      ,    Carlos

    E      ,    Carlos

    F      ,    Carlos

    G      ,  Luis

    H        ,  Maria

] Group By Salesperson;