Alteryx Designer Desktop Discussions

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

Creating new column with values based on previous column values

dberroth
8 - Asteroid

So I'm trying to get around the basic sort tool Alteryx provides, I need rows to come out in specific order. The three types I will have is 

 

Freight

Non-Freight

Blank ( previous tool I'm using creates totals for all values in a row, this field is blank as this is not a numeric column). 

 

In a perfect world, I would have all the 'Freight' listed first, then 'Non Freight' then the 'Totals' row ( which is blank for this column ). 

 

So my idea is to create a new column if Freight, then equals 1, Non Freight equals 2, blank equals 3, then sort down the line... I'm having problems getting this formula to work to create a new column. 

 

Side note, if possible...would be even better if I can insert a blank row between these values would be even better!!!

 

Appreciate any help.

 

Desired Result

 

'New column'

Freight Records

(Blank row)

Non-Freight Records

(Blank row)

Totals

7 REPLIES 7
carlosteixeira
15 - Aurora
15 - Aurora

Hi @dberroth Can you try use this workflow to help you.

 

Take a look

 

best regards

Carlos A Teixeira
fmvizcaino
17 - Castor
17 - Castor

Hi @dberroth ,

 

Attached is an example showing how to accomplish that.

fmvizcaino_0-1580144586822.png

 

Let me know if this works for you.

BEst,

Fernando Vizcaino

dberroth
8 - Asteroid

Thanks for the info both, I feel like this one has got me on the right track, but unfortunately the rows are being doubled up now and my subtotals at the bottom of the page are now missing. Any ideas on why that would be?

fmvizcaino
17 - Castor
17 - Castor

Hi @dberroth ,

 

Would you be able to share the part of the workflow where the problem is happening? If not, it could be a set of screenshots showing the duplication at least.

 

Best,

Fernando Vizcaino

dberroth
8 - Asteroid

Hey Fernando - I was able to manipulate the if statements that you provided without the others and was able to make that work. I Appreciate your help on that. It got me to where I need to be! Last Question...

 

If you were wanting to enter blank rows between specific data in an excel sheet, do you have any recommendations on where to look for that?

 

 

carlosteixeira
15 - Aurora
15 - Aurora

Hi @dberroth Use the generate lines tool that is in the workflow that I shared with you.

Carlos A Teixeira
fmvizcaino
17 - Castor
17 - Castor

Hi @dberroth ,

 

I would use the function contains to identify the specific line you want and fill another column with 2, then I would use this column to be the column guiding the generate rows tools as I've done in my example.

So, everywhere your contains formula identifies the text, it will be generated one duplicated line. After that, you can use the formula tool to replace everything you want in the duplicated line.

 

Best,

Fernando Vizcaino

Labels