Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
markgraham123
Specialist
Specialist

Create a sequence number and create buckets

Hi all,

I'm working on a requirement where i have to

1. Sort my data by time and Order

2. Create a sequence number group by Time. An order gets only 1 sequence #.

I'm only able to create sequence # grouped by Time but not able to give just  only 1 sequence # to an order.

3. Create buckets of 16 or 8 orders. In my below example data, if i'm not able to create a bucket of 16 or 8, then i give them '99999' value. First priority is to create 16 orders bucket and then 8.

Any help is highly appreciated. Please see attached QVW.

BucketSequenceOrderSKUTime
11120960148683977
12120961506859307
13159092150504607
131590921501279087
14159095632474167
14159095632764287
151590977981142057
16159110791524807
17159117140913807
171591171401437587
18159119418766997
999999159121210905757
99999101591270361512667
11120873063868818
12120879952849998
13120880115489698
14120882274917228
151209118231135788
161209937121408708
171209937181063458
18121021508868248
19121022075757488
110121023970647218
1111210303121408648
1121210351481084368
113121044204940538
114121063982601358
1151210657251152948
116121073529646828
2171211128741431248
218121120191862798
2191211208111077358
2201211255671304268
220121125967486788
221121125986770858
222121126490697438
223159055750895558
224159121194481018
224159121194517588
9999925159121557927898
9999926159122588481038
99999271591231391447528
9999928159123777848398

 

Labels (4)
1 Solution

Accepted Solutions
sunny_talwar

Actually, this one is better

View solution in original post

8 Replies
markgraham123
Specialist
Specialist
Author

@sunny_talwar  Any of your help is highly appreciated!

sunny_talwar

Check attached

 

markgraham123
Specialist
Specialist
Author

Sunny,

I first have to check for 16 order bucket. If i donot get 16, then i check for 8. Finally i apply '99999' value for those cant be bucketed in neither 16 nor 8.

sunny_talwar

What if Time 8 had more than 32 rows? Say 36 rows... what would it look like then?

markgraham123
Specialist
Specialist
Author

Then it creates 2  - 16 order buckets and rest get '99999'

sunny_talwar

Not sure if this works always or not, but try this

sunny_talwar

Actually, this one is better

markgraham123
Specialist
Specialist
Author

You are the best out of best, brother!!

 

Thanks a ton!! You solved my issue!!!

 

Thanks again 🙂 🙂