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.
We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!
Be sure to review our Idea Submission Guidelines for more information!
Submission GuidelinesA seemingly minor task that has popped up several times on my team is the ability to select a subset of columns using an input list. Different people have achieved this in different ways (transpose/join/cross-tab, dynamic rename/select), but it seems like a common enough task to warrant a single-tool solution.
R has a simple way to do this:
# create a vector of the columns we would like to select
columns <- c("column_b", "column_d")
# subset based on the column names we defined in our "columns" vector
df_subset <- df[columns]
We have built a macro to achieve this (attached), but I would love if there was a second input anchor on the Dynamic Select tool, with list-based select mode as an option in the dropdown.
The macro currently has a minor annoyance, where the user gets a "RecordInfo::CreateRecord" error presented on their palette when they choose the "Keep Columns in List" entry. This error goes away with a run or an F5 refresh, but if anyone has a suggestion for getting rid of this, it would also be appreciated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.