Start Free Trial

Alteryx Designer Desktop Discussions

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

Create and populate a column using IF conditions

Inactive User
Not applicable

Hello community,

 

I'm looking to create column A (Change Type) and populate based on these conditions:

 

- If Column E (New Value)'s cell shows "Terminated", the value for that employee in Column A will populate "Terminated".

- If Column D doesn't show value for multiple rows but has values in Column E, then Column A should indicate "New Employee"

- If Column D & E have values for multiple rows then, populate "Update" in Column A.

 

I've attached the desire output. Hope it makes sense.

13 REPLIES 13
Emmanuel_G
13 - Pulsar

Hi @Inactive User ,

 

Do you want something like this ?

Emmanuel_G_0-1658879774823.png

 

flying008
15 - Aurora

Hi, @Inactive User 

 

Please see that below.

IF Contains([Concat_New Value], "TERMINATED") THEN "TERMINATED" 
ELSEIF IsEmpty([Concat_Old Value]) && !IsEmpty([Concat_New Value]) THEN "New Employee"
ELSEIF !IsEmpty([Concat_Old Value]) && !IsEmpty([Concat_New Value]) THEN "Update" ELSE Null() ENDIF

 

录制_2022_07_27_08_04_41_618.gif

Inactive User
Not applicable

Hi @flying008, are you able to share the workflow please? 

Inactive User
Not applicable

Hi @Emmanuel_G, thank you for the workflow, it's turning out good.

additional conditions.png

I'd like to add these two conditions:

 

- There are line where the employee has only one or two records. I'd like to classify the Change Type as "Update" instead of "New Employee" if there are less two 2 lines for that employee.

 

- If the "Pack" under the "Attribute" column has values in both old and new. Then classify the change type as "Transfer".

Emmanuel_G
13 - Pulsar

Hi @Inactive User ,

 

Good to know that it works.🙂

 

Find attached the workflow with these two conditions added in yellow container.

 

Let me know if there is some issue.

Emmanuel_G_0-1659038710896.png

 

Inactive User
Not applicable

Hi @Emmanuel_G, would you be able to integrate all four conditions into one output? The last two additional conditions are being generated separately.

Emmanuel_G
13 - Pulsar

Hi @Inactive User ,

 

Find attached the workflow with all the 4 conditions for one input.

 

Let me know if there is any concern.

 

Emmanuel_G_1-1660915977470.png

 

Inactive User
Not applicable

Thanks, that's working well. I'm encountering another scenario where i want the grouping of the employees then populating the IDs if they're present.

populate IDs.jpg

populate IDs 2.jpg

Emmanuel_G
13 - Pulsar

Hi @Inactive User ,

 

Happy to help! Can you please mark this answer above as solution? 🙂

 

Find attached the solution to this scenario.

 

Do not hesitate to mark this answer as solution if it helped for this new scenario.

 

Emmanuel_G_0-1663622170048.png

 

Labels
Top Solution Authors