Start Free Trial

Alteryx Designer Desktop Discussions

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

Compare multiple weeks and flag fields

laurennewton
8 - Asteroid

Hi community!

 

My goal is to take a LARGE historical database (a few million records) and compare week to week and then add flags when necessary. Here's an example:

 

week, unique id, 

 0      ,   12345  

1       ,    12367

1       , 12345  

2       , 12367

 

desired outcome:

 

week,   unique id,  New Req Flag

0      ,     12345,     [null]

1      ,      12367,   X

1     ,        12345,  [null]

2    ,         12367, X

 

currently my worklow only compares the most recent week to the past week but i would like to expand its to compare week 0 to week 1 then week 2 to week 1 and so on until it hits week 99 which is the most current week. I was thinking of making an iterative macro possibly? but i would think i would need some sort of control parameter to indicate that the week is changing? any advice?

2 REPLIES 2
PhilipMannering
16 - Nebula
16 - Nebula

I think you missed out the detail of what the flag represents. Should it be 'X' if consecutive weeks have an identical [unique id]? If so, this may work,

image.png

laurennewton
8 - Asteroid

thanks for replying! i've attacked a sample workflow of where i'm at.. i am able to flag from week 0 to week 1 but i want to find a way to repeat this process for multiple weeks so for example it would change to week 1 to week 2 and then week 2 to week 3 and so on. 

Labels
Top Solution Authors