Hi,
I have columns Jan to Dec along with some other columns. I need to do current month - previous month to see if there is a change and pick that row in filter tool.
For example, if current month is May, then I need to pick May and Apr columns from Jan to Dec. How can I achieve this dynamically based on current month?
Thanks in advance.
Dynamic Select is your best bet! Not sure what your columns look like so it's hard to help further, but TLDR you can use logic to select certain columns with this tool in a dynamic way
@bhanus As @alexnajm suggested, Dynamic Select tool will do.
For example, by using text input tool having following mapping data, rename header name to number(January => 1, February => 2...) by Dynamic Rename tool.
In Dynamic Select tool configuration, set the following expression so as to pass the columns which is the current or later month.
ToNumber([Name])>=ToNumber(DateTimeFormat(DateTimeToday(), "%m"))
After that, rename the header to the original format by another Dynamic Rename tool.
Overall WF looks like this.
@bhanus
A bit late for the party. 😁
I will go with the Dynamic Select tool and I understand that you only want to keep the Col "May" and "April" in case running worflow today.
Baselly I just use the DateTime function to convert the column of month, "Jan", "Feb" to number of Month, then compare with the month of "DateTimeToday()".
I also add a mapping file at the end, since the column name would be dynamic, we should map the column name in order to do the calculation for difference.
Thanks Alex,
The Columns are like Jan-24, Feb-24, Mar-24.....Dec-24. I need to do current month - previous month and if there is a change then I will pick that row using filter tool.
Thanks Alex,
The Columns are like Jan-24, Feb-24, Mar-24.....Dec-24. I need to do current month - previous month and if there is a change then I will pick that row using filter tool.
@bhanus
If they are like Jan-24, Feb-24, Mar-24., we can just add another identifier as below/
User | Count |
---|---|
53 | |
27 | |
26 | |
24 | |
21 |