Alteryx Designer Desktop Discussions

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

updating the members of a field based on the member of another field

Bryth
8 - Asteroid

Hello team, 

 

I need help with this in Alteryx.  I have to update the duration Field to be 8 if the sub event type is Day off. I have tried this If logic but I I dont want to include Elseif/ Is there a way to go around this in Alteryx? 

 

Bryth_0-1685999091471.png

 

5 REPLIES 5
geraldo
13 - Pulsar

@Bryth 

 


there has to be the else
if [sub...] == 11Try...' then 8 else [Visit...]
endif

 

the if construction is wrong

Bryth
8 - Asteroid

It outputs 0 for all the day off when I use the Visit duration before the endif

 

IF [Sub Event Type]="Day Off" THEN [Visit Duration] = '8' Else [Visit Duration] ENDIF

geraldo
13 - Pulsar

@Bryth 

 

 
if it's different from Day Off, what does it have to be?
Yoshiro_Fujimori
15 - Aurora

Hi @Bryth ,

 

Your Formula configuration shows [Visit Duration] in the expression.

Yoshiro_Fujimori_0-1686007448874.png

If you want to update [Visit Duration] column, you should specify it in "Output Column" as below.

Yoshiro_Fujimori_1-1686007556800.png

The reason why it outputs "0" for all the day off is that the expression [Visit Duration] = "8" is false (= 0).

 

I hope this helps.

geraldo
13 - Pulsar

@Bryth 

 

 
you can use the switch:
 
formula example:
Switch([Sub Event Type], Null(),'Day Off',8, 'Day A', 1,'Day B',2)
 
geraldo_0-1686009410442.png

 

Labels