Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
raju_salmon
Creator II
Creator II

Creating Buckets

Hi All,

I have requirement to show transaction length in buckets. I need to show buckets like <2 hours, 2-4hours,4-6hours....so on till <7days.

   

Trans_IDVendorTrans length in seconds
1A1236
2B1548
3A2368
4C1568797
5A468
6A123578
7B12356879

I need to show bucket and vendor as dimension (Is it possible?) and need to see how many transaction falls and each bucket.

Can i create bucket like this?

If (Trans length in seconds<=7200, '<2 hours',

If (Trans length in seconds>7200 and Trans length in seconds<14000, '2-4 hours',))... so on...as Bucket

And can i use bucket and vendor as dimension and count (Trans_ID) as expression?

Can you please tell if any easy way to do this? or am i following correct way?

Thanks.

Raju

8 Replies
PrashantSangle

Hi,

check Buckets

Might help you.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
raju_salmon
Creator II
Creator II
Author

Thanks max. In that example i have found only Bucket dimension.

Can i use multiple dimension when i use Bucket as dimension?

PrashantSangle

Hi,

Yes it is possible.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable

What exactly you mean to say?

like this?

=if((Dim1>10 and Dim1<20),if((Dim2>10 and Dim2<20),'10-20')) as Bucket

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If created in your load script, Bucket becomes just another field with a transaction property. Just like Vendor is a transaction property. You can use Bucket like any other field, in chart dimensions, expressions, set analysis, variables, conditional show (for example to display all transaction details for category '>= 7 days' e.g. the bad ones)

raju_salmon
Creator II
Creator II
Author

Thanks peter, i have created like you suggestion.

MarcoWedel

Hi,

one solution could be to create a bucket field in the script using an expression like:

Dual(Floor([Trans length in seconds]/3600,2)&' - '&(Floor([Trans length in seconds]/3600,2)+2)&' hours',Floor([Trans length in seconds]/3600,2)) as TransLength;

QlikCommunity_Thread_197872_Pic1.JPG

QlikCommunity_Thread_197872_Pic2.JPG

tabTrans:

LOAD *,

    Dual(Floor([Trans length in seconds]/3600,2)&' - '&(Floor([Trans length in seconds]/3600,2)+2)&' hours',Floor([Trans length in seconds]/3600,2)) as TransLength;

LOAD RecNo() as Trans_ID,

    Chr(64+Ceil(Rand()*20)) as Vendor,

  fabs(Ceil(NORMINV(Rand(),0,1/'00:00:01'))) as [Trans length in seconds]

AutoGenerate 30000;

hope this helps

regards

Marco

vikasmahajan

PFA

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.