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.
Hi, I have 06 columns- ID, Q1, Q2, Q3, Q4, and Month, based on month value like 1,2,3, I want to select ID and Q1 while if Month is 4,5,6 I wanna ID and Q2. Just tried using a dynamic filter but not work, any help will help me to understand how to filter columns.
You could utilize Filter and Select in tandem. Off of your data stream, filter on Month IN (1,2,3). Then off of your True Output use a Select Tool to only pass through ID and Q1. Connect another Filter and Select Tool to the data stream to complete this for Q2, and then again for Q3 and Q4. If you then need this to all be pulled back together, use a Union Tool to to bring back in all 4 individual streams.
To dynamically select columns, you can use a tool called "Dynamic Select" which will allow you given a certain expression to drop/select some of your fields.
You have correctly identified that a part of the expression needed to be used is:
and we should check the results of that expression against values from 1-12 to define the quarter. The tool should be configured as shown below:
where you essentially select, given that DateTimeMonth(DateTimeToday()) numeric value, that you want to select all field containing Company ID and Q1 in their name.
So you can see in the results window, I have the desired result.
I've run a test if the date was the 1st of August 2020, and the tool appears to work correctly (only kept Q3 column, so I expect to keep working correctly in the future if your dataset always has a column names "Colmpany ID" and Q1-4.
Hope that helps, let me know if you have any questions.