Free Trial

Alteryx Designer Desktop Discussions

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

Checking row condition based on some column and save result as a new file.

sumitrathore
6 - Meteoroid

Hello guys,

 

I'm pretty new to Alteryx, so far I was doing good but here I got stuck.

I'm attaching a file below where I want to apply condition on few columns and separate the "School" column values based on it. Conditions are mentioned in the table below:

Column Name32 Questions28 Questions
P91,23,4,5
P113,4,51,2
P171,23,4
P181,21,2,3
P251,23,4,5
P261,23,4
P273,4,51,2
P281,2,31,2

All conditions mentioned in the table should be meet Suppose if column P9 has values 1,2  it is 32 Question and if 3,4,5 than it is 28 Question row and so on for the other mentioned in the table. I want to separate all the rows based on 32 and 28 questions based on the above table condition.

So there is gonna be two files one for 28 questions and another for 32 questions.

                                                                      OR

Can also add a new column naming "Questions" and say 28 and 38 questions based on the condition for a single file.

Any help would be greatly appreciated. Thanks in advance.

 

***UPDATED***

 

 

 

8 REPLIES 8
echuong1
Alteryx Alumni (Retired)

I'm a little unclear regarding what you are trying to accomplish. Are you able to post a sample "end output?"

 

If you are trying to get a count for each value based on that criteria, you can do something like this:

echuong1_0-1604951553445.png

 

sumitrathore
6 - Meteoroid

This looks good and I might use it for some of my problems but this is not what I'm looking for.

So basically you used the if-else, where 1,2 is 32 Question and 3,4,5 are 28 Question but its checking condition for all the columns and giving the count. I want to separate the file based on the condition that I have mentioned in the table above to the 32 and 28 questions.

Sorry for the confusion.

Qiu
21 - Polaris
21 - Polaris

@sumitrathore 
Add to the effort of @echuong1 , I have modified the workflow a bit and hope this is what you are looking for.

1110-sumitrathore.PNG

sumitrathore
6 - Meteoroid

The table I have mentioned in the main body are all the conditions that we want to check before saying it is a 32 or 28 question.

So in the table are all the conditions that need to be met before we add a column. Both of you just checked a condition where 1,2 is 32 questions and 3,4,5 is 28 questions but it is way more complicated not just one condition there are multiple conditions that are mentioned in the table. I'm so sorry for the confusion and not being clear.

Qiu
21 - Polaris
21 - Polaris

@sumitrathore 
I am starting to get what you mean.

In your snapshot, only a few conditions are given.
However, in your Excel Data, there are like 32 of them.

How to do this?

Qiu
21 - Polaris
21 - Polaris

@sumitrathore 
So this is what you need?1110-sumitrathore-r1.PNG

sumitrathore
6 - Meteoroid

Like you did in previous solution need 2 files based on only those conditions that are mentioned in the table and rest of them should be there as it is, or you can just check the condition and place a new column after P32 that says 28 and 32 base on all the condition at once. Thanks for understanding and being so quick.

sumitrathore
6 - Meteoroid

Just by adding a filter, I'm able to get what I wanted to.

Thank you so much 😊

Labels
Top Solution Authors