Alteryx Designer Desktop Discussions

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

If Value for Period is Null, Replace with Value from Other Period

hellyars
13 - Pulsar

 

I want to say...

 

if [PERIOD]="B" && ISNULL([RIGHT_AMNT]) then

Get Value for the intersection of [PERIOD]="BY1" && [RIGHT_AMNT]

else [RIGHT_AMNT]

endif 

 

PERIODAMNTRIGHT_AMNT DESIRED RIGHT_AMNT
P200100 200
C100150 100
B175Null 153
O25Null Null
BY1200153 153
BY230050 50
     
4 REPLIES 4
mceleavey
17 - Castor
17 - Castor

Hi @hellyars ,

 

use a formula tool on the column you wish to amend. 

 

if isnull([RIGHT_AMNT]) then [AMNT] else {RIGHT_AMNT] endif

 

or, if the cell is actually populated with the word Null, then:

 

if [RIGHT_AMNT]="Null"  then [AMNT] else {RIGHT_AMNT] endif

 

Hope this helps.

 

M.



Bulien

hellyars
13 - Pulsar

Since PERIOD is a pattern that repeats for each set of records, I tried using a Multi-Row Tool.

 

if [PERIOD]="B" and isnull([Right_AMNT]) then [Row+2: Right_AMNT] else [Right_AMNT] endif 

 

But, it does not seem to work.  It replaces the Null with a 0 instead of the correct value.

hellyars
13 - Pulsar

@mceleavey My bad.  I should not have used the same values for B.  The values from AMNT and Right_AMNT will not always be the same.  Will correct, thanks.

hellyars
13 - Pulsar

It did not work with the real data at first, but now it is -- so that's a win.  

 

 

if [PERIOD]="B" and isnull([Right_AMOUNT]) then [Row+2:Right_AMOUNT] else [Right_AMOUNT] endif 

 

 

Labels