Alteryx Designer Desktop Discussions

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

Count consecutive weeks from today

Yatesaj8
7 - Meteor

I'm trying to get a count of how many consecutive weeks (including the current week) a customer appears on a list. If the customer does not appear in the current week, then they should count as 0. How would I write a formula to get this?

 

I currently have the data set up similarly to the left 3 columns. The desired results are in the right 2 columns. For the sample data below, we are currently in week 5.

 

Any help would be greatly appreciated. It's my first week in Alteryx and this kind of thing has me very confused.

 

 

    Correct Results
CustomerWeekCurrent week Customer 
115 15
125 22
135 30
145 41
155 52
215 60
225   
245   
255   
345   
425   
435   
455   
545   
555   
625   
635   
645   
2 REPLIES 2
mceleavey
17 - Castor
17 - Castor

Hi @Yatesaj8 ,

 

I've done this by breaking out a little multi-row magic:

 

mceleavey_0-1619636880999.png

 

I determined the max week for each customer and used this to determine if they had a sequence that ran into current week. Then it was a simply matter of counting sequences from that number.

Workflow attached.

 

I hope this helps.

 

M

 



Bulien

Yatesaj8
7 - Meteor

Thank you SO much! 

 

If you have a minute, would you mind explaining the formula for counting the sequences?

Labels