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.

IF statement with multiple condition

faisal9999
8 - Asteroid

I want to translate this below code into alteryx can anybody help me out

 

 

WHEN platform NOT IN ('Amazon Display', 'FireTV') THEN

(CASE WHEN video_completion_25pct=0 THEN youtube_views ELSE video_completion_25pct)


WHEN platform='FireTV' THEN video_start ELSE 0

 

there are two condition which am not able to put in alteryx.

 

4 REPLIES 4
FrederikE
13 - Pulsar

Hey @faisal9999,

 

This should do: 

 

IF [platform] NOT IN ('Amazon Display', 'FireTV')

THEN 

 

IF video_completion_25pct=0

THEN youtube_views

ELSE  video_completion_25pct

ENDIF

 

ELSEIF platform='FireTV'

THEN video_start

ELSE 0

ENDIF

 

Raj
16 - Nebula

try this

 

IF [platform] NOT IN ('Amazon Display', 'FireTV') THEN
IIF([video_completion_25pct]=0, [youtube_views], [video_completion_25pct])
ELSEIF [platform] = 'FireTV' THEN
[video_start]
ELSE
0
ENDIF

faisal9999
8 - Asteroid

Thank you @Raj @FrederikE  both solution worked for me :)

Raj
16 - Nebula

Please mark it as solution !!
Have a great Weekend.

Labels
Top Solution Authors