Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ecolomer
Master II
Master II

Segment customers in levels

I have an table with sales to customers and the area where the sale occurs.

There are customers who may be in more than one area.

Levels: T1 and T2 are defined by user

I would analyze those sales by three levels:

- Customers in an area whose sales are less than a user-defined value (T1)

- Customers whose sales are between T1 and T2

- Customers whose sales are higher than T2

For each tranche would like to know the number of customers, sales, average selling each zone.

Attached basic example with Excel file and QV

Thank's in advance

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Similar idea like maxgro.

Count( DISTINCT Aggr( if(Sum(Venta)<$(T1), Cliente), Zona, Cliente))

Sum( Aggr( if(Sum(Venta)<$(T1), Sum(Venta)), Zona, Cliente))

Latter should also work with more than one Venta record per Cliente and Zona.

View solution in original post

6 Replies
swuehl
MVP
MVP

Maybe like attached?

ecolomer
Master II
Master II
Author

Thank's, but I can't touche the script

Any idea?

maxgro
MVP
MVP

maybe, for T1

Count(distinct if(aggr(sum(Venta), Cliente,Zona)<$(T1), Cliente))

sum(if(aggr(sum(Venta), Cliente,Zona)<$(T1), Venta))

swuehl
MVP
MVP

Similar idea like maxgro.

Count( DISTINCT Aggr( if(Sum(Venta)<$(T1), Cliente), Zona, Cliente))

Sum( Aggr( if(Sum(Venta)<$(T1), Sum(Venta)), Zona, Cliente))

Latter should also work with more than one Venta record per Cliente and Zona.

ecolomer
Master II
Master II
Author

Thank's

ecolomer
Master II
Master II
Author

Thank's