Dear Team,
I am trying to extract data from some large tables and i am looking a way to create a Batch macro input that uses variable year and month data in extracting the data.
Year format is "YYYY" while month is formatted as "MM".
Year Structure:
Name | Selection | Operator | LowKey | HighKey | Split |
RYEAR | I | EQ | 2024 | True |
Month Structure:
Name | Selection | Operator | LowKey | HighKey | Split |
MONAT | I | EQ | 01 | True |
The macro should dynamically change the "LowKey" values for both tables. These tables will then be joined using the union tool and then fed into another tool to extract the data. Then i want this data saved into a folder that has this structure automatically: YYYY > MM > "output.csv". If the folder doesn't exist then it should be created.
For example, if extracting data for 2022, the macro will cycle through months 01 to 12, then move to the next year in the list.
Inputs:
Years (>= 2020): Generated using the "Generate tools".
Month: 01 - 12
Many thanks in advance for your help.
Solved! Go to Solution.
You can concatenate the two fields to create a single input with a delimiter and then use update by formula to parse your control parameter within your actions that feed off of the control parameter.
Hi Dan,
This is the input tables table
Name | Selection | Operator | LowKey | HighKey | Split |
RYEAR | I | EQ | 2024 | True |
Month Structure:
Name | Selection | Operator | LowKey | HighKey | Split |
MONAT | I | EQ | 01 | True |
Final outcome will change the Lowkey for the upper year (1st Table) and another one will change the month data (2nd Table). This data are then now combined into an output macro that is then fed into another tool.
Combined table would look like below:
Name | Selection | Operator | LowKey | HighKey | Split |
RYEAR | I | EQ | 2024 | True | |
MONAT | I | EQ | 01 | True |
This is with the a DVW SAP Tool - correct? You'll need to use two control parameters - and two action tools - these will feed into the tool's parameters - my memory is that there is a ton of trial and errror in trying to figure out where the selectors are in the tool (there's like 100 different components and things aren't labeled great). I don't have access to a system with DVW or even SAP ECC so I can't really help more than that.
Indeed. Its a DVW SAP tool.
I dont have a problem with the SAP tools though, just that i need to be able to iteratively change the year and months without the need to manually do it myself.
Considering your suggestion, is there a way that you can provide a sample workflow. I would love to pick a year and run the month input from Jan - Dec before moving to the next year in the list.
Many thanks!
Marking it as solved. Reached out to the DVW team and they already have a solution that works for my use-case. I should have probably done that from the onset 😅.
Thanks everyone for for the advice and pointers.