Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Calculate an active count of consecutive weeks

salemalnahdi14
6 - Meteoroid

Hi,

 

Would love some ideas on how to build a column that counts the number of recurring weeks based on a given week.

 

For example, I have a list of products with weeks purchased:

 

Product IDWeek of Year (Purchased)
11122
11123
22224
11124
22219
33315
33316
22214
44424
33320

 

I want to calculate, the consecutive weeks an item was purchased from week 24. Therefore the new column would look like this based on the data above:

 

Product IDWeek of Year (Purchased)Formula
111223
111233
222241
111243
222191
333150
333160
222141
444241

 

Appreciate the help!

1 REPLY 1
Felipe_Ribeir0
16 - Nebula

Hi @salemalnahdi14 

 

Try the attached workflow.

 

consecutiveweeks.png

Labels