If statement with Vlookup
- 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, I'm a beginner using Alteryx and need help figuring out how to replicate a formula in my Excel sheet through Alteryx. Basically, I'm using a vlookup to find a SKU value in a different file, and use an if statement to put "Yes" as a match or "No" if there's no match or NaN. I've attached sample data below. I know I need to use either the Join or Union (or both?) tool and possibly the formula tool for the If statement? Any help is appreciated, thank you
Solved! Go to Solution.
- Labels:
- Join
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Welcome to the Community. On the left under Academy > Interactive Lessons, there are some nice Excel lessons in the section Alteryx for Excel Users.
Use the Join like you mentioned.
Out of the J anchor, use a Formula tool to create a new field for Matched, data type Boolean.
Formula:
IF [SKU in 2nd file] = "NaN" THEN 0 (zero means No or False)
ELSE 1 (1 means Yes or True)
ENDIF
out of the Left anchor, use a Formula tool to create a new field for Matched, data type Boolean. Formula: 0
then feed the output from both Formula tools into a Union tool.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for the help and guidance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Alayna
Just as you have mentioned, a joint tool can do the work.
And we can also try to use Find and Replace.
But I am having difficulty to understand your input and output based on the logic you gave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for your reply Qiu. I didn't explain that well but Chris's answer helped me out. I will also look into find and replace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Looks like you already got the input you need, but attached a workflow for you if that helps.
Matt
