Alteryx Designer Desktop Discussions

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

Replicating a For Each Loop in Alteryx?

Bnstates
7 - Meteor

I had posted this question yesterday, but couldn't readily try out the offered solution, and have now realized that it would not work. I'll try to give more detail in this post.

 

I'm trying to find a way to replicate a For Each loop. I need to be able to take the average of the volume for specific members for each as of date, and display this average for all member statuses. However, member statuses other than "Member" will not be included in the average.

 

Ex:

 

For Each as of date

If Plan = 1 and Member Status = Member, then Average(volume)

If Plan = 2 and Member Status = Member, then Average(volume)

...

End if

Next as of date

 

I don't believe a simple summarize would work, unless I can request the specific members within the summarize somehow. I have attached a simple sample of how I want the end product to look.

 

Appreciate any help on this!

 

1 REPLY 1
estherb47
15 - Aurora
15 - Aurora

Hi @Bnstates 

 

Doesn't look like you'd need a macro here. You can use a combination of the Filter and the Summarize tools.

 

First drop a Filter tool, and filter for where Member Status Equals Member
image.png

 

Next, add the Summarize tool, with Plan number and As of date as Group by fields, and Volume as an averaged field.

 

 image.png

 

You can join this back to your original data, joining on the Plan # and As of date fields. That will add the average volume to each record for each plan number and as of date.

 

Let me know if that helps!

 

Cheers,

Esther

Labels