Max Ifs
- 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
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @ctheo - here's my take on this:
1) Chuck a RecordID on for final sorting
2) Parse the dates into ISO format so we can use them for sorting in Alteryx (think sorting on the format you're already using should be fine but I always like to convert just to be safe)
3) Sort rows based on the date
4) Create a Multi-Row Formula to check whether [Amount] is larger than the [Expected] value in the row above
5) Use the previous [Amount] value if so, and the [Expected] value if not
6) Re-sort and clean up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
So you want the maximum of all rows before the current row for that title. Take a look at the attached. The Multi-row will get you your answer, but depending what you want to do with that answer, the top technique may help.
With the Multi-row, we only replace the answer if the answer on the previous row is larger than the amount. I left my first quick attempt there as well before I looked at the answer you were generating.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am not familiar with MaxIfs() of Excel, but I tried to follow the expected output.
I used Batch Macro as your expression seems to change the reference ranges at each row.
If you are not familiar with Macro, please check the Interactive Lessons for Macro.
https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Macros
I hope this helps.
Main Workflow
Batch Macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for your help! I love the simplicity of the solution
