Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Creating a new column and assigning a "word1" to first 50% records and "word2" to the rest

driz
6 - Meteoroid

Hi All, 

 

I am attempting to create a new column (using the Formula tool) called "Owner". I have a list of data in which i need to assign the first half to Owner 1 and the second half to Owner 2. Anyone has any idea how i can do this with just Formula Tool? 

 

 

4 REPLIES 4
Qiu
21 - Polaris
21 - Polaris

@driz 
Maybe you can use Create Sample tool to split the data stream then assign "Owner" respectively.

Then union back the data streams.

2024-08-27 161424.png

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Another solution may be to compare the record ID and the threshold calculated separately.

Here is a sample workflow. I hope this helps.

1311426.png

driz
6 - Meteoroid

Hi Qiu,

 

Thanks for the response, my version of Alteryx only has the following sample methods and i cant seem to get to your example:

"First N Rows"

"Last N Rows"

"Skip 1st N rows"

"1 of every N rows"

"1 in N chance to include each row"

"First N% of rows"

 

I am able to split the first 50% of rows but unable to do so for the last 50% since there isnt such an option. 

 

I cant send a screenshot because of IT security issues. 

 

driz
6 - Meteoroid

Thanks Yoshiro, this works!

Labels
Top Solution Authors