Alteryx Designer Desktop Discussions

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

Need expression that will indicate whether two similar columns are both populated

bryanmason19
7 - Meteor

I need to write an expression that will look at two columns of data and tell me whether or not both are populated or one is populated and the other is blank, vice versa. I am assuming I will use the Formula or Filter tool. The two fileds are titled, Customer Segment and Revised Customer Segmement. Thanks

2 REPLIES 2
Coxta45
11 - Bolide

@bryanmason19,

 

Try this formula:

 

(Populated_Expression) =

 

IF !IsEmpty([Customer Segment]) AND !IsEmpty([Revised Customer Segment]) THEN "Both Populated"
ELSEIF !IsEmpty([Customer Segment]) AND IsEmpty([Revised Customer Segment]) THEN "Only First Populated"
ELSEIF IsEmpty([Customer Segment]) AND !IsEmpty([Revised Customer Segment]) THEN "Only Second Populated"
ELSEIF IsEmpty([Customer Segment]) AND IsEmpty([Revised Customer Segment]) THEN "Neither Populated"
ELSE "Error"
ENDIF

 

Expression.png

 

Results...

 

Pop_Results.png

 

Taylor

MarqueeCrew
20 - Arcturus
20 - Arcturus

just for fun ...

 

IIF(isempty(Trim(regex_replace([Customer Segment],"(.+)","Cust Seg")+" & "+regex_replace([Revised Customer Segment],"(.+)","Rev Cust Segment")," & ")),"None",Trim(regex_replace([Customer Segment],"(.+)","Cust Seg")+" & "+regex_replace([Revised Customer Segment],"(.+)","Rev Cust Segment")," & "))

this expression will replace Customer Sement & Revised Customer Segment and create your data in the format of:

 

Capture.PNG

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels