This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
ALTERYX INSPIRE | Join us this May for for a multi-day virtual analytics + data science experience like no other! Register Now
1 Day Left! - The Alteryx Community will be temporarily unavailable for a few hours due to implementation of the new SSO experience starting tomorrow at 5pm MDT. Please plan accordingly. For more information, read the blog.
Can you please try and rephrase your question slightly because to me it's not clear what you are looking to achieve. So I see that you have some columns and every week, the name of a column changes (depending on the date, week count? Do 0230 and 0310 relate in a way in your example or are they just arbitrary numbers).
@ToxicBuoy thank you for that, now it makes more sense.
For you to find the maximum date between your different columns, you can transpose your data to get all column headers in a single column. Then you can use a formula tool, to convert the column headers to a date format.
Subsequently with the summarize tool, you can find the maximum date in your dataset, and once you join it back to the original stream, the max date from your dataset will fall out of the J output anchor. This is where you can add a formula tool to create your new column, and then it's just a matter of bringing it all back together.
If my input is :
Then my new formula is applied in column XY_0201, concatenating the ID and the values in said column XY_0201
Now if I add another column in my input, XY_0208
then the formula has been applied in the newly introduced column
Hope that makes sense, it isn't the cleanest of ways but it appears to be working. Let me know if you have any questions.
If you know that it's always the last column that you need to use in a formula, who can use a technique like this
The Field Info tool extracts metadata, i.e., name, type, etc. from the input and returns it as a series of rows. Take the last row with a sample tool and use a formula tool to create a static name for the last column. Use Dynamic Rename to rename the last column to this static name. Apply your formula or transformations using the static name. When you've finished manipulating the data in the final column, use a second Dynamic Rename to restore it's original name. Try adding another column to the input or removing the last one to see the effect. Note that if you add or remove the last column, you'll get an error before you run the workflow, since Alteryx won't be able to figure out where the [UseInFormula] comes from. Run the workflow and the error will disappear.
You can extend this technique to multiple columns if you can determine some way to filter for only those column names.