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: 
selvakumara
Creator
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 in advance

Thanks.

14 Replies
QlikNoviceNo1
Contributor III
Contributor III

Hi Selva,

Is client the only dimension in the chart?

Could you share the chart/qvw?

Thanks.

QlikNoviceNo1
Contributor III
Contributor III

Aggr.PNG

selvakumara
Creator
Creator
Author

Yes. Client only in the dimension.

Capture.PNG

Measures - Count (Client)

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

vamsee
Specialist
Specialist

Your measure has to be Count( Distinct Client)

MarcoWedel

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

selvakumara
Creator
Creator
Author

Didn't solve my issue  @ Marco Wedel

selvakumara
Creator
Creator
Author

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.