# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2023, a live, in-person thrill ride. Save \$300 before February 6: REGISTER NOW!
cancel
Showing results for
Did you mean:
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

1 Solution

Accepted Solutions
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.

6 Replies
MVP

Maybe like attached?

Master II
Author

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

Any idea?

MVP

maybe, for T1

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

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

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.

Master II
Author

Thank's

Master II
Author

Thank's

Community Browser