Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Reference Column (Or Count) with Multiple Criteria

LindonB
8 - Asteroid

Hello,

 

I am somewhat new to Alteryx and am trying to do something seemingly simple. I have a group column and a date column (and a column for values, so each date will be listed more than once per group). I want to (in the end) keep only the 10 largest values for each group. I have sorted the columns so that they are grouped by group and date and then listed (largest to smallest) by value. I know what to return a reference count (1,2,3...,n) per group per day. Basically, a Record ID with criteria is what I'm after. Any help would be great! I have attached a sample workflow.

 

Thanks!

2 REPLIES 2
BenMoss
ACE Emeritus
ACE Emeritus
Check out the multirow formula tool to build a ‘nested rank’ as i like to refer to it as.

Use the ‘create new field’ option and lets call this Rank.

In your group by options pick the fields that you want to nest by, i.e. your date and group field.

Then specify the formula as

[row-1: Rank]+1

You can then use the filter tool to pull only the top 10 for each group/date.

Its worth noting, you dont actually need the Rank field to do this.

The sample tool allows you to select the first N records (N being 10 in this instance), and again it allows you to soecify grouping fields, so it will return the first 10 records for each group. Now providing you have sorted your data appropriately before the sample tool then this will work fine.

Ben
LindonB
8 - Asteroid

Ben, this is very helpful and both methods worked well. Thanks!

Labels