Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

How to do if x then do something else do nothing?

Hamder83
11 - Bolide

Hi 

Im trying to generate new rows, if a cell value if not empty.

Fx.: 
Customer - Product - Service
Dennis        Parcel     Special handeling
Mona          Parcel     (null)/empty 

So 

If
!IsEmpty([Serivce]) THEN 
[product] = [service] 
Else (dont generate a row? 
ENDIF 


ive attached a simple workflow showing how im trying to solve it .. 

Tried this too : 
IIF(!IsNull([Service]), "Enviromental-Fee", [Product)

7 REPLIES 7
Ladarthure
14 - Magnetar
14 - Magnetar

Hi @Hamder83,

 

could you give an example of what result you would like to have?

Hamder83
11 - Bolide

Hi 

Sure .-) 

Customer - Product - Service 1 - Service 2 - Service 3 
Dennis        Parcel     SMS           Letter         Oil fee 
Anna           Parcel     SMS  

For each customer i should generate 1 row for product - and one line for each service, with product having service text.

So for Dennis it would be:
Dennis - Parcel 
Dennis - SMS
Dennis - Letter
Dennis - Oil fee 

For Anna:
Anna - Parcel 
Anna - SMS 


But i should only generate a line if there is content in the service cell.

 

Ladarthure
14 - Magnetar
14 - Magnetar

Ok, to do so, you can use a transpose tool which transforms multiple columns in 2 columns and then filter to exclude the null/empty values (find a solution attached!)

 

Hope it helped!

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @Hamder83,

 

I believe this is what you're trying to achieve?

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

subhajits11
8 - Asteroid

Hi,

Try this, in multi field formula.Hope this will help dynamically for all fields in the data set (if required)

 

IF [_CurrentField_]="X" THEN "0" ELSE [_CurrentField_] ENDIF

 

For not dynamic use- field name in formula tool f(x) instead of [_CurrentField_]

 

Regards,

Subhajit

sartol
7 - Meteor

This looks very useful, but the multi-row formula tool says that _CurrentField_ is not a variable

Luke_C
17 - Castor
17 - Castor

@sartol 

 

They are referencing the multi-field formula tool which is different than the multi-row formula tool

Labels
Top Solution Authors