Hi,
I have a table which describe some check rules to be applied on some files, like this:
rule id | colum | comparator | value | filename |
r1 | A | < | 25 | file1_dummy.xlsx|sheet1 |
r2 | X | = | 42 | file1_dummy.xlsx|sheet1 |
r3 | G | > | 13 | file2.xlsx|sheet2 |
In this table, I have 3 rules:
I try to create a "batch" macro wich take in control parameter a table with the unique list of files:
filename |
file1_dummy.xlsx|sheet1 |
file2.xlsx|sheet2 |
and in input the first table.
Into the macro (yxmc), I've done some dummy treatment like:
then output all this.
Note that I have 3 lines in file1 and 4 lines in file2.
The input module, is the copy/paste of data of the first line of the first table (and I've put the same name in the header row).
It's confogured to be a "batch macro".
Finally I try to use my macro in my main workflow (yxmd) in many ways / configurations :
- Without any grouping, it output 2 times the first line:
count | rule id | colum | comparator | value | filename | Length |
3 | r1 | A | < | 25 | file1_dummy.xlsx|sheet1 | 23 |
3 | r1 | A | < | 25 | file1_dummy.xlsx|sheet1 | 23 |
- With Control GroupBy Field : filename, I have the same result:
count | rule id | colum | comparator | value | filename | Length |
3 | r1 | A | < | 25 | file1_dummy.xlsx|sheet1 | 23 |
3 | r1 | A | < | 25 | file1_dummy.xlsx|sheet1 | 23 |
- With Control GroupBy Field : filename and, Input GroupBy Field: filename; the output is a little bit more interesting, but not yet what I want:
count | rule id | colum | comparator | value | filename | Length |
3 | r1 | A | < | 25 | file1_dummy.xlsx|sheet1 | 23 |
4 | r3 | G | > | 13 | file2.xlsx|sheet2 | 17 |
If I use any other filed in Input GroupBy Field; it make an error at the execution as the input file Worksheet1.xlsx is not existing.
What I excepted to have:
- my macro be called 2 times with 2 chunks (grouped by filename)
- 1 chunck for file1, with 2 first line in input
- 1 chunck for file2, with 1 last line in input
And so that, it will load each file only 1 time (and so here in my example, not load the file1 two times).
How can I achieve this?
Regards,
Alex
Hi @Bargeton ,
You don't appear to have created a batch macro but a standard macro.
Can you provide the batch macro so we can have a look? Also, if you could package some dummy data to show what you are trying to do.
Thanks,
M
It's configured as a batch macro as you can see in the screenshot.
I will not able to share any code unfortunately :/
I've created a simple workflow to use this macro, with 2 text inputs.
As you can see, I configure to group by Filename.
I've put 3 comments with a background image to display the input table, and the computed output table.
The line 2 with control id R2 is missing from the output..
Regards,
Alex
Ok so in fact... in the macro, the module "dynamic input" from the developer package, load only one file.
So the output has only 1 table, and the count.. count only the line for one table.
It's not really a problem as it's exactly what I want: load only 1 time the file (and as it's a batch macro on filename, it will call the macro with unique filename in input).
I not really understand why it's load only 1 time, or have only 1 table in output... even if in the macro, to test it locally by executing it directly, I put 2 distinct files into the list of the input, it load only the first line.
Regards,
Alex
@Bargeton, try this macro. Just change the input directory to your folder.
I hope it helps!
Thanks!