Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Multi field formaula - replace nulls with other fields value

Shaman
7 - Meteor

I have a data set and want to replace nulls with respective values from other fields:

RegionPeriod 1Period 2Period 3Period 4Period 5Period 6Period 7Period 8Period 9Period 10Period 11Period 12Right_Period 1Right_Period 2Right_Period 3Right_Period 4Right_Period 5Right_Period 6Right_Period 7Right_Period 8Right_Period 9Right_Period 10Right_Period 11Right_Period 12
AS300320325330335340345350    300300300300300300300300305310315320
EU100150155160165170175180    100100100100100100100100105110115120
LA400420425430435440445450    400400400400400400400400405410415420
ME200220225230235240245250    200200200200200200200200205210215220
NA500550555560565570575580    500500500500500500500500505510515520

Periods 1 to 8 shall remain, Period 9 to 12 shall get the value from columns "Right_Period x"

I tried with Multi field formula:

if isNull([_CurrentField_])
Then [Right_[_CurrentField_]]
else [_CurrentField_]
endif

I get an error, "", + and & after "Right_" does not help, any idea how to solve?

6 REPLIES 6
Hollingsworth
12 - Quasar
12 - Quasar

The Multi-Field Formula tool does not work that way so it's not that you aren't using it correctly.

 

Are those four fields (9-12) the only fields that will be potentially null? Or do all 12 fields have the potential to be null? 

John Hollingsworth
Clear Channel Outdoor
Emil_Kos
17 - Castor
17 - Castor

Hi @Shaman,

 

As I didn't know how many columns your true data have I have created a dynamic solution that should work for any number of columns:

Emil_Kos_0-1624997646383.png

 

The downside of this solution is that the column names don't have underscore anymore. As I was thinking it isn't a big deal I have made a shortcut for myself. They are in the same order.

 

Like @Hollingsworth you aren't able to achieve the desired result with the multifield formula. You need something more complex. 

 

KarolinaRoza
11 - Bolide

Hi @Shaman ,

 

 

I am not sure if Multi-Field formula will work, but I prepared solution which solve your problem without using that Tool.

 

You can Transpose rows to column, then check for example: if [Period 12] is null in the same time then [Right_Period 12] is not null, and if yes then supplement the value from Right_Period column.

To do it you can use Multi-Row formula instead.

 

Then transpose data back using Cross-Tab.

 

KarolinaRoza_0-1624997970364.png

 

 

Please check if it works for you,

Karolina

 

 

 

 

Emil_Kos
17 - Castor
17 - Castor

Hi @KarolinaRoza,

 

Regex and multi-field formula. That is much more efficient than my solution. Nicely Done! 🙂

apathetichell
18 - Pollux

2021-06-29 (1).png

I just wanted to make a workflow and name it "let the right one in..." and I like Dynamic Select... 

 

Shaman
7 - Meteor

Hi @apathetichell 

very nice solution, just need dynamic approach like the solution from Karolina

Labels