Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
sivaboggarapu20
Partner - Creator
Partner - Creator

Bucket intervals

Hi Team,

I have Field called Bucket which is contain values like 1 to 10000


I want to make it as 1 to 999 as 1stBucket

                                 1k to 2.9k as 2nd Bucket

                                  3k to 5k  as 3rd Bucket


I want to display like above. Can anyone help me to get above

Thanks,

Siva

4 Replies
bwisealiahmad
Partner - Specialist
Partner - Specialist

Hi,

I would probably do this with an IF statement in the script unless you want exact intervals. Then you can use the Class Function - https://help.qlik.com/en-US/sense/June2018/Subsystems/Hub/Content/Scripting/ConditionalFunctions/cla...

Script Example:

Temp:

LOAD * INLINE [

    Number, Value

    A, 100

    B, 2000

    C, 500

    D, 250

    E, 7500

    F, 300

];

Fact:

LOAD

*,

IF(Value <= 250,'1st Bucket',

     IF(Value <= 500,'2nd Bucket',

     '3rd Bucket')) AS Buckets

// Above you can define how you want them to be divided in the IF Statement.

Resident Temp;

Drop Table Temp;

Gives you this:

Capture.PNG

Best,

Ali A

agigliotti
MVP
MVP

what's your expected output ?

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
BalaBhaskar_Qlik
Master
Master

Create like this in script or chart:

  IF(Bucket >= 1 and Bucket < 999, '1st Bucket',

  IF(Bucket >= 1000 and Bucket < 2999, '2nd Bucket',

  IF(Bucket >= 3000 and Bucket < 5000, '3rd Bucket',

  '4th Bucket'))) as Bucket

Now create a chart

Dimension

Range

Expression

COUNT(Distinct Bucket)

Chanty4u
MVP
MVP

Have a look

Buckets