We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Get a value from differerent columns

Gaetano_B
8 - Asteroid

Hi All,

 

I have column A which contains a mix of 0s and 1s.

Column B contains a mix of 0s and 2s.

 

I kindly need a column C which pulls all the 1s and 2s from col. A&B.

Any suggestion?

 

Many Thanks,

Gaetano

7 REPLIES 7
atcodedog05
22 - Nova
22 - Nova

Hi @Gaetano_B 

 

Can you provide some sample data.

 

Thanks

Gaetano_B
8 - Asteroid

hello @atcodedog05 ,

 

Please see attached, thanks very much.

AngelosPachis
16 - Nebula

Hi @Gaetano_B ,

 

I have attached a workflow that solves the issue. I have assumed that Flag and Flag 2 fields are strings. Otherwise you can use a Formula tool to add the two columns and then remove the records where the value is 0 

 

Let me know if that worked for you  🙂

atcodedog05
22 - Nova
22 - Nova

Hi @Gaetano_B 

 

Here is a workflow for the task.

 

Output:

atcodedog05_0-1602850858263.png

Workflow:

atcodedog05_1-1602850874235.png

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

Gaetano_B
8 - Asteroid

Thanks @atcodedog05 , I'm getting the following error:

Gaetano_B_0-1602851897584.png

Are you able to help?

atcodedog05
22 - Nova
22 - Nova

Hi @Gaetano_B 

 

Can you try this formula it might be type issue. 

 

IF ToNumber([Flag])!=0 THEN [Flag] 
ELSEIF ToNumber([Flag2])!=0 THEN [Flag2] 
ELSE Null() ENDIF

 

Hope this fixes. Feel free to reach out if it doesnt fix.

atcodedog05
22 - Nova
22 - Nova

@Gaetano_B 

 

This one will even work if there are spaces.

IF trim(ToString([Flag])," ")!="0" THEN [Flag] 
ELSEIF trim(ToString([Flag2])," ")!="0" THEN [Flag2] 
ELSE Null() ENDIF

Hope this helps 🙂

Labels
Top Solution Authors