# New to QlikView

Discussion board where members can get started with QlikView.

New Contributor III

## Create buckets conditionally based in dimension

Hi Team,

I am using the below expression.

=if(Aggr( Count(  client) , client)<=1, '1 time Visit'

,if(Aggr( Count(  client) , client)<=2, '2 time Visit'

,if(Aggr( Count(  client) , client)<=3, '3 time Visit'

,'More than 3 Visit'

)))

But it always give the 1time visit also not calculating correctly.

Thanks.

14 Replies
New Contributor III

## Re: Create buckets conditionally based in dimension

Hi Selva,

Is client the only dimension in the chart?

Could you share the chart/qvw?

Thanks.

New Contributor III

## Re: Create buckets conditionally based in dimension

Highlighted
New Contributor III

## Re: Create buckets conditionally based in dimension

Yes. Client only in the dimension.

Measures - Count (Client)

Valued Contributor

## Re: Create buckets conditionally based in dimension

Try

=Aggr(

IF(

Count(Client)<=1, '1 Time Visit',

IF(Count(Client)=2, '2 Time Visit',

IF(Count(Client)=3, '3 Time Visit',

IF(Count(Client)>3, 'More Than 3 Time Visit', ))))

,Client)

Valued Contributor

## Re: Create buckets conditionally based in dimension

Your measure has to be Count( Distinct Client)

MVP

## Re: Create buckets conditionally based in dimension

Hi,

another expression for your calculated dimension might be:

```=Aggr(If(Count(client)<=3,Count(client)&' time Visit','More than 3 Visit'),client)
```

hope this helps

regards

Marco

New Contributor III

## Re: Create buckets conditionally based in dimension

Still, I'm facing same issue. It is showing the 1 time visit rather than all the visit.

I don't know what I am missing.

New Contributor III

## Re: Create buckets conditionally based in dimension

Didn't solve my issue  @ Marco Wedel

New Contributor III

## Re: Create buckets conditionally based in dimension

In the 137309 id falling under 1 and 3 time visit. But it's not coming correctly. That's my problem