recreating vlookup in alteryx
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
That was it! THank you so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
