Dynamically Drop Columns
- 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
i need to drop certain columns dynamically and i've been trying to use dynamic select as an option to do this.
I want to drop all columns that end in "P06". However, sometimes it will be P05 or P04 or anything based on the number of years of data I have. Data is attached. Any suggestions appreciated.
Thanks!
- Labels:
- Dynamic Processing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Nvm - solved this by transposing, parsing out the column names, finding the max period using a summarize tool, and joining back to filter out the max period.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can use Select Via a Formula option in Dynamic Select, then use the following expression:
REGEX_Match([Name], ".*[12345]$") or [Name]="CustomerName"
If you want to drop all columns that end in "P05”,just change the expression to:
REGEX_Match([Name], ".*[12346]$") or [Name]="CustomerName"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@apatel1501
You still can use Dynamic Select tool, as long as you can define what is needed to be removed you will be able to do it with Dynamic Select. By using the Dynamic Rename Tool you can Update fields Description, last option. Use Field Info tool and then based on your logic filter all the headers that are not needed. Create a new fields named Description and set it with Need, Keep or any other word. Connect your data to Dynamic Renaming tool and than update fields Description, add a Dynamic Select tool and then select Formula. Set a Formula Description=Keep or any word that you used and you will be left only with the needed headers.
