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

recreating vlookup in alteryx

wave_wstn
7 - Meteor

Hi Alteryx,

I am trying to recreate this vlookup I did in excel in alteryx, but I am stuck. I was able to create the age column, but now I am stuck on creating the bucket column. thanks to everyone that helps in advance!

 

I tried to do 

if [Age]<=30
then 0-30
else
if [Age]<=60
then 31-60
else
if [Age]<=90
then 61-30
else
if [Age]>90
then 90+
endif

but it just made it angry

5 REPLIES 5
Luke_C
17 - Castor

Hi @wave_wstn 

 

You could tweak your if statement to this and it should work. You need to put your buckets in quotes and also just use 'elseif' rather than 'else if'

 

if [Age] > 90 then "90+"
elseif [Age]<=90 and [Age]>=61 then "61-90"
elseif [Age]<=90 and [Age]>=61 then "31-60"
else "0-30"
endif

wave_wstn
7 - Meteor

I tried to do what you said, but for some reason it still gets angry. I even tried it without the endif to keep the colors from changing, but it still wouldn't run. Is there a specific reason for that or are there just too many arguments?

@Luke_C 

Luke_C
17 - Castor

Interesting, works fine for me. Can you confirm the age field is numeric? You should also make this new field for bucket a string rather than numeric

 

wave_wstn
7 - Meteor

That was it! THank you so much!

goutdelete
8 - Asteroid

Hi..

 

Any chance anyone knows an equivalent solution to an approx vlookup VLOOKUP( value, range, index_number, TRUE or 1) in Alteryx?

 

I have a very similar use case and since both my range bucket and target value are both long list and constently changing, I really don't want to do a long nesting IF statement..

 

Thanks!

 

 

Labels