Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
arvind_patil
Partner - Specialist III
Partner - Specialist III

Cumulative Bucket in qliksense Script

Dear Experts,

I have help regarding below data:

Table1:

USERID            TAT      

1                        5

2                        11

3                        7

4                        4

5                        3

I need to clasify this values in below bucket according to TAT:

Bucket:

0 to 5

0 to 10

> 0 or all


O/p

~so in my  0 to 5  bucket user id comes- 1,4,5

~so in my  0 to 10  bucket user id comes- 1,4,5,3

~so in my  > 0 or all  bucket user id comes- 1,4,5,3,2

Thanks,

Arvind Patil

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Something like

Bucket:

LOAD DISTINCT TAT, Dual('0 to 5',1) as Bucket

RESIDENT YourTATTable

WHERE TAT <=5;

LOAD DISTINCT TAT, Dual('0 to 10',2) as Bucket

RESIDENT YourTATTable

WHERE TAT <=10;

LOAD DISTINCT TAT, Dual('>0 or all',3) as Bucket

RESIDENT YourTATTable

;

Now the Bucket groups link to the correct TAT values, so you can use them e.g. as dimension in your chart to count users.

edit: added DISTINCT qualifier.

View solution in original post

3 Replies
swuehl
MVP
MVP

Something like

Bucket:

LOAD DISTINCT TAT, Dual('0 to 5',1) as Bucket

RESIDENT YourTATTable

WHERE TAT <=5;

LOAD DISTINCT TAT, Dual('0 to 10',2) as Bucket

RESIDENT YourTATTable

WHERE TAT <=10;

LOAD DISTINCT TAT, Dual('>0 or all',3) as Bucket

RESIDENT YourTATTable

;

Now the Bucket groups link to the correct TAT values, so you can use them e.g. as dimension in your chart to count users.

edit: added DISTINCT qualifier.

arvind_patil
Partner - Specialist III
Partner - Specialist III
Author

Hi Stefan,

Is there any way i can achieve this in same table.

Thanks,

Arvind Patil

swuehl
MVP
MVP

I think not without duplicating your fact table records.