# 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:
Creator

## 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.

Please help me to get all the 3 buckets also looking for alternative solutions.

Thanks.

14 Replies
Contributor III

Hi Selva,

Is client the only dimension in the chart?

Could you share the chart/qvw?

Thanks.

Contributor III

Creator
Author

Yes. Client only in the dimension.

Measures - Count (Client)

Specialist

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)

Specialist

Your measure has to be Count( Distinct Client)

MVP

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

Creator
Author

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.

Thanks for  your response.

Creator
Author

Didn't solve my issue  @ Marco Wedel

Creator
Author

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

Thanks everyone for your response.

Community Browser