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
Solved! Go to Solution.
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
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?
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
That was it! THank you so much!
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!