Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
selvakumara
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.

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

Thanks in advance

Thanks.

14 Replies
QlikNoviceNo1
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.

QlikNoviceNo1
New Contributor III

Re: Create buckets conditionally based in dimension

Aggr.PNG

selvakumara
New Contributor III

Re: Create buckets conditionally based in dimension

Yes. Client only in the dimension.

Capture.PNG

Measures - Count (Client)

vamsee
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)

vamsee
Valued Contributor

Re: Create buckets conditionally based in dimension

Your measure has to be Count( Distinct Client)

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

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

Thanks for  your response.

Highlighted
selvakumara
New Contributor III

Re: Create buckets conditionally based in dimension

Didn't solve my issue  @ Marco Wedel

selvakumara
New Contributor III

Re: Create buckets conditionally based in dimension

Capture.PNG

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.