Alteryx Designer Desktop Discussions

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

If Then Statements

sslattery17
8 - Asteroid

I am trying to remove data from one field based on data in another.  I have many properties [Unit Type] the string needs to Find and replace the [Deposit Held] for each:  Having an issue with if statement; can the group help me with where I am missing the proper statement.  Or alternate resolution.  I attached screen shot and data.  The issue is when I fill down resident name; I am capturing the total of all deposits held for that property also for the last resident.  Highlighted for visual understanding in screen shot. 

 

 

IF [Unit Type] IN ("11th & Spruce Total:") then [Deposit Held] ="0" else 0 endif

 

IF [Unit Type] IN ("11th & Spruce Total:",
"250 High Total:",
"600 Goodale Total:",
"80 On The Commons Total:",
"801 Polaris Total:",
"Baxter Park Total:",
"Bracken House Total:",
"Buckstone Flats Total:",
"Burrough's Mill Total:",
"Devonshire Total:",
"Dixon House Total:",
"Edison at Gordon Square Total:",
"Emerson Park Total:",
"Gateway Lakes Total:",
"Gateway Lofts Centerville Total:",
"Gateway Lofts Columbus Total:",
"Gateway Lofts Lansing Total:",
"Gateway Lofts Lexington Total:",
"Graham Park at The Highlands Total:",
"Harper House at The Highlands Total:",
"Heritage Green Total:",
"Lane Lofts Total:",
"Lofts at Norton Crossing Total:",
"Lumina Total:",
"Luxe 88 Total:",
"Luxe at The Highlands Total:",
"Madison House Total:",
"Marina Lofts Total:",
"Marine Club Total:",
"Market & Main Total:",
"Minnetonka Station Total:",
"Mulberry Lofts Total:",
"North Shore Flats Total:",
"Packard Building Total:",
"Park's Edge at Shelby Farms Total:",
"Pennbrook Station Total:",
"Polo Run Apartment Homes Total:",
"Pulliam Square Total:",
"Rize at Opus Park Total:",
"Spectra Total:",
"Spring House at Brandywine Total:",
"Station 324 Total:",
"Steel House Total:",
"Stillwell at Avery Centre Total:",
"Stillwell Jerome Total:",
"Stilwell at Wellen Park Total:",
"Sugar Run Total:",
"The Aubrey Total:",
"The Baylor Total:",
"The Darby at Briarcliff Total:",
"The Flats at Douglas Total:",
"The Gramercy Total:",
"The Jacqueline Total:",
"The Kingston Total:",
"The Monarch Total:",
"The Normandy Total:",
"Preserve at Forest Creek Total:",
"The Reserve of Sugarcreek Total:",
"The Stratton Total:",
"The Thomas Total:",
"View on Grant Total:",
"Tribeca Total:",
"Willis Avondale Estates Total:") then [Deposit Held]= "0" else 0 endif

13 REPLIES 13
Bobbyt23
12 - Quasar

If I understand correctly are you trying to make it blank if in any of those?

 

If that's the case you just need to change this end bit

then [Deposit Held]= "0" else 0 endif

 

To

 

then NULL() else 0 endif

 

sslattery17
8 - Asteroid

@Bobbyt23 yes, but when I type out the statement; I receive an error stating invalid type in operator.  I have tired syntex a couple of time and ways still have the same issue.  Is it because I am using if in? 

Bobbyt23
12 - Quasar

can you share a screengrab of the workflow so I can see what you are getting?

Qiu
21 - Polaris
21 - Polaris

@sslattery17 
Can you share your current flow?
Looking at your Excel data get me more confused...😁

sslattery17
8 - Asteroid

@Qiu  see attached workflow.  Can you also look at the regex_replace([Resident],"[^\sa-zA-Z]",'') in the workflow.  The second resident in the column is not being moved to a different column and any resident that is a llc company; it moves the llc to the beginning.

Bobbyt23
12 - Quasar

OK for the first part I think it is because you are using the formula within a filter tool. Are you wanting to filter to get rid of those ones or are you wanting a formula that does something with them?

 

image.png

 

I couldn't run it to test as the macro wasn't attached in the workbook.

 

If you can attach it with the input data as a yxdb file it will be easier to troubleshoot.

sslattery17
8 - Asteroid

Yes @Bobbyt23  

 

IF [Unit Type] IN ("11th & Spruce Total:") then [Deposit Held] ="0" else 0 endif  

 

The above statement is what I am trying to accomplish.  What is in red is just a partial list of the unit types as seen in the workflow.

 

In each of thoese unit types is a deposit held of some value; i need those to be zero.

Bobbyt23
12 - Quasar

OK in that case you want to use a formula tool and not a filter tool. If you put that in a formula tool it should work.

sslattery17
8 - Asteroid

@Bobbyt23 I moved it but that did not work either; it gives the same error message.

Labels
Top Solution Authors