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

User interactive bucket size / variables

I think it's very common question but I can't find a concrete answer yet.

The question is very simple.  I want to make my charts with dynamic bucket.

For example, 

existing age group are pre-defined with

1. 0-18

2 19 -28

3. 29-50

4. > 50

How can I make a UI which the users can change it dynamic on screen (I cater this via the loading scripts now).

 

Similar requirement for sales amount as well which I may need to define multiple groups

Scenario 1 (three classes):

Sales <= 100000

Sales > 100000 and <= 500000

Sales > 500000

Scenario 2 (two classes):

Sales <= 500000

Sales > 500000

 

4 Replies
swuehl
MVP
MVP

If the user interaction is limited to choosing between different scenarios (like in your Sales example), then you can create each scenario using a field in your load script, creating alternative dimensions in your chart and let the user select one of the alternative dimensions in the UI.

Or should the user be able to change the number of buckets as well as the bucket sizes (with different sizes to make it most complicated)?

yipchunyu
Creator
Creator
Author

Yes, I would like to make it flexible to allow users to allow make changes on-demand.   Any advice is appreciated 

yipchunyu
Creator
Creator
Author

sorry, any idea is welcomed.  

yipchunyu
Creator
Creator
Author

Up to now, I used some dull solutions as create certain variables and check against these on the dimension.  Any other better solution is welcomed.

=If( Owner_Age>= $(vBktAge1) and Owner_Age < $(vBktAge2), Dual('['& $(vBktAge1) & ', ' & $(vBktAge2) & ']', 1) ,If(Owner_Age>= $(vBktAge2) and Owner_Age < $(vBktAge3), Dual('['& $(vBktAge2) & ', ' & $(vBktAge3) & ']', 2) ,If(Owner_Age >= $(vBktAge3) and Owner_Age < $(vBktAge4), Dual('['& $(vBktAge3) & ', ' & $(vBktAge4) & ']', 3) ,If(Owner_Age >= $(vBktAge4) and Owner_Age < $(vBktAge5), Dual('['& $(vBktAge4) & ', ' & $(vBktAge5) & ']', 4) ,If(Owner_Age >= $(vBktAge5), Dual('[>='& $(vBktAge5) & ']', 5))))) )