Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Calculation Without using Nested If

bala14_07
7 - Meteor

 

Hello Team

 

Here is the below table and I wanted to have a column(Resultcolumn) based on this criteria

High is D + 1year, Medium is D+3year and Low is D+1 year

 

The different scenarios are

 

1.So  when Categ1 is High & Categ2 is Null - I want date as date plus one year

2. Low & Null --> date plus five years

3. Medium & Null --> date plus three years

 

If anything other than NULL in Categ2, it should take categ2 into account

 

Can it be done without nested if? Wanted to know. Kindly help

Category1Category2DateResultcolumn
HighNull30-07-202030-07-2021
HighLow29-07-202030-07-2025
NullHigh20-07-201920-07-2020
MediumHigh10-07-201510-07-2016
LowMedium22-09-201822-09-2021
LowHigh11-05-201811-05-2019
NullNull11-05-201811-05-2018
6 REPLIES 6
bpatel
Alteryx
Alteryx

hi @bala14_07 ,

 

you can split up the nested if statement into individual if statements... is this what you were looking for?

bpatel_0-1596127057778.png

 

bala14_07
7 - Meteor

 

Hello Patel

 

Thanks a lot for this. Is it possible to do with Switch statement?

bpatel
Alteryx
Alteryx

@bala14_07 ,

 

the switch function does one single comparison. i think the best option for this would be to do if statements

AbhilashR
15 - Aurora
15 - Aurora

Hi @bala14_07, does the approach in the attached workflow work for you?

 

 

 

bala14_07
7 - Meteor

Hello Abhilash

 

Thanks a lot for you solution. This was the only solution I could think of as well. Really helpful abhilash

bala14_07
7 - Meteor

@bpatel 

 

Thanks for the clarification patel. Got it

Labels