Start Free Trial

Alteryx Designer Desktop Discussions

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

Adding output column based on filter criteria applied

Swati_Kejriwal
5 - Atom

Hi all, am trying to add an output column and populate the filter criteria reason. My filter criteria has more than 20 criteria which is spread across multiple columns. So if a row is meeting one of the filter criteria the the output column should populate the corresponding value from the source column. If more than one filter criteria is met then the output should be based on the first 

 

Sample:

Filter Criteria [Data 2] = "A" OR [Data 2] = "B" OR [Data 3] = "1" OR [Data 3] = "2"

Data 1Data 2Data 3Filter Reason
ID1A1A
ID2B5B
ID3C3 
ID4D11
ID5A5A
ID6B2B
ID7F22
ID8U9 



2 REPLIES 2
Elias_Nordlinder
11 - Bolide

Hello @Swati_Kejriwal ,


I have done an example workflow below, can you see if this meets your requirements?

 

* If you use an IF Clause, it will automatically populate with the first

criteria first, second criteria after and so on.

 

* First IF Clause is first criteria.

- IF [Data 2] IN ("A","B") THEN [Data 2]

 

* Second IF Clause is second criteria.

- ELSEIF [Data 3] IN (1,2) THEN [Data 3]

 

* Third IF Clause will be third criteria.

- ELSEIF blablabla = blablabla THEN blablabla

 

* Fourth IF Clause will be fourth criteria etc. etc.

 

(I use the IN clause in stead of the one you provided as it

is a short version of using OR.)

[Data2] = "A" OR [Data2] = "B" is the same as
[Data2] IN ("A","B")

 

Elias_Nordlinder_2-1628917105217.png

 

 

Elias_Nordlinder_0-1628917089096.png

 

Elias_Nordlinder_1-1628917100575.png

Elias_Nordlinder_0-1628917481412.png

 

 

 

Let me know if this will help you in your workflow 🙂

 

//Regards

Elias

 

Swati_Kejriwal
5 - Atom

yes it worked. Thank you so much !! 

Labels
Top Solution Authors