Missed the Q4 Fall Release Product Update? Watch the on-demand webinar for more info on the latest in Designer 24.2, Auto Insights Magic Reports, and more!
Free Trial

Alteryx Designer Desktop Discussions

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

If/Then by grouping by Min Date issue

adam_jones
7 - Meteor

New to Alteryx. I need a way to create new column for patients of first dose vs follow up doses. In Tableau the equation was 

 

If [Admin Date] =
{fixed [Account Number], [Prescription Number] : str(Min([Administration Date]))}
then 'First Dose'
else 'Follow Up Doses'
END

 

I need to get the Min or earliest [Administration Date] on each specific Prescription Number, within each grouping of Account Numbers.

8 REPLIES 8
bensilv
Alteryx Alumni (Retired)

Hi @adam_jones could you share some dummy data as an example?

 

You could use a summarize tool to group by Prescription Number, taking the Min Date, then join back to the data. Then use a formula tool to compare the administration date to the min date.

messi007
15 - Aurora
15 - Aurora

@adam_jones,

 

Could you share a sample data with the expected result?

It will help us to give you the solution.

 

Best Regards,

adam_jones
7 - Meteor

*Not actual Date (obviously)*

 

Essentially, I need each earliest date of each prescription of each patient to come back as First Dose and everything else is Follow-Up.

 

If I do the summarize tool, do they work in stacking order? Ex. I group Account, then group Presc. #, then min admin date. Then do IF *new column* = [Admin Date] Then "First Dose" ELSE "Follow-Up" ENDIF?

adam_jones_0-1629819034281.png

 

messi007
15 - Aurora
15 - Aurora

@adam_jones,

 

Yup summarize and formula tool will do the job.

If you can share image as an excel will be better for us to help you 🙂

 

Regards,

adam_jones
7 - Meteor

Here's the file.

 

Thank you in advance.

messi007
15 - Aurora
15 - Aurora

@adam_jones,

 

Please see below

messi007_0-1629820449961.png

Attached the workflow

Hope this helps!

 

Regards

 

binay2448
11 - Bolide

Find attached solution for the same

 

 

adam_jones
7 - Meteor

This worked, thank you again!

Labels
Top Solution Authors