This how to will describe how to setup user defined buckets. The biggest difference with predefined buckets (last how to post) is the flexibility for the end-user who can choose a variable bucket width.
I will stick with the same example: a database contains a table with data of people. The table contains an age field. The thing we want to do is divide all ages in groups with a variable bucket width:
Copy paste the following load inline in script:
LOAD * INLINE
[ Name, Age
Next create a variable so the end-user can choose the width. In Qlikview, click Settings and pick “Variable Overview”
Add a new variable and name it vBucketWidth
Finally create a chart to display the buckets.( (Right Mouse, New Sheet Object, Chart)
The class function creates buckets as big as the size of vBucketWidth. Click next.
Add the expression count(Name) and click finish. (This will count how many persons are in a bucket)
Enter a bucketWidth and have fun!