Alteryx Designer Desktop Discussions

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

Formula question involving if-contains-then I'm struggling with

adriennelenker
7 - Meteor

Hi all,

 

This is an issue I'm struggling with. I I have the table below with the following conditions needed. If a condition is true, create a new column that's filled in for all of the User ID rows.

A - If a User ID contains any month before 2021, populate ResultA for all User ID rows.

B - If a User ID contains "deactivated", populate ResultB for all User ID rows

C - Populate ResultC with the person's name of the latest month, the same name for all ResultC rows for a single UserID 

D - For a User ID, for Condition D, if the row of the latest month is null, populate ResultD for all User ID rows.

 

The desired result is below.

Condition AUser IDCondition BCondition CCondition DResultAResultBResultCResultD

Dec 2020

A

Active

James1xxMattx
Jan 2021AActivePaul2xxMattx
Feb 2021ADeactivatedMatt xxMattx
Jan 2021BActiveAnkur1  Sanjayx
Feb 2021BActiveSanjay   Sanjayx
Jan 2021CActiveJessica1 xBrooke 
Jun 2021CDeactivatedBrooke2 xBrooke 

 

I am trying to use formulas with if-contains and end up with the following:

 

Condition AUser IDCondition BCondition CCondition DResultAResultBResultCResultD

Dec 2020

A

Active

James1x   
Jan 2021AActivePaul2    
Feb 2021ADeactivatedMatt  xMattx
Jan 2021BActiveAnkur1    
Feb 2021BActiveSanjay   Sanjayx
Jan 2021CActiveJessica1    
Jun 2021CDeactivatedBrooke2 xBrooke 

 

Is there a way to write the formulas to obtain my desired result? I appreciate all help. Thank you.

10 REPLIES 10
ShankerV
17 - Castor

Hi @adriennelenker 

 

Please find the expected output.

 

ShankerV_0-1676349963539.png

 

Many thanks

Shanker V

adriennelenker
7 - Meteor

Hi Shankar,

 

I can't take a detailed look right now, but is this the top table or the bottom table I posted? From the screenshot it looks like the bottom table, I'm trying to obtain the top table. Thanks

ShankerV
17 - Castor

Hi @adriennelenker 

 

Got it, it is possible; with few tweaks in the workflow.

ShankerV
17 - Castor

Hi @adriennelenker 

 

Please find the expected result as per the first table.

 

ShankerV_0-1676350949249.png

 

Many thanks

Shanker V

adriennelenker
7 - Meteor

Hi Shankar,

 

Thank you for replying, this is very helpful. i’m just wondering, is there any way to make this dynamic so it works with different situations, not just this one? I have a large dataset with differing values in the columns. Also, is this only possible with multi-row formulas, and not with regular formulas? Thanks

adriennelenker
7 - Meteor

Also, is condition C working? Thanks

ShankerV
17 - Castor

Hi @adriennelenker 

 

The workflow created is dynamic.

It cant be achieved with regular formula's as we need to check the previous row data's. That is possible only with Multi-row formula tool.

 

adriennelenker
7 - Meteor

Thank you, it’s a bit late where I am, I will definitely check in the morning. I appreciate the help.

grazitti_sapna
17 - Castor

@adriennelenker , Please find my below solution if this was what you were looking for:

 

grazitti_sapna_1-1676352662119.png

 

 

Sapna Gupta
Labels