Hello,
I'm trying to create a batch macro to apply modifications on an other file.
I have one file with the dataset and one file with the list of modifications.
For example :
List of modifications
ID | Training | Username | Field to modify | Modification |
1 | Training 1 | User 1 | Hours | 4.00 |
2 | Training 2 | User 2 | Type | C |
3 | Training 1 | User 1 | Type | C |
Dataset
Training | Username | Name | Hours | Date | Type |
Training 1 | User 1 | XXXX | 2.00 | 2020-12-31 | C |
Training 1 | User 1 | XXXX | 1.00 | 2020-12-31 | D |
Training 2 | User 1 | XXXX | 2.00 | 2020-12-31 | D |
Training 1 | User 1 | XXXX | 4.00 | 2020-12-31 | D |
Training 2 | User 2 | YYYY | 4.00 | 2020-12-31 | D |
Training 2 | User 2 | YYYY | 2.00 | 2020-12-31 | C |
And in the result I want to apply the [Modification] in the [Field to modifiy] column for the depending [Username] and [Training].
For the moment my Batch Macro seems to works for one cases per Training/Username but not if I have 2 modifications for the same couple Training/Username (at the end I have the 2 modfiications done but in separete lines ..)
Can you have ideas to solve that problem ?
Thanks
Hi @JulienSchanen ,
Is it necessary to go down the batch macro path? There is an alternative way which might be simpler and easier to troubleshoot in the future, but that is subject to the dataset you are using.
Essentially you are bringing your original dataset table to a similar structure as the list of modification table (i.e. Hours and Type in the same Column).
That allows you to join on some fields (Training, Username, New column containing Hour and Type with Fields to modify column) and then simply use a formula tool to swap the old values with the modification where that is necessary.
Hope that works for your instance, let us know if it has to be a batch macro and surely we can figure this out.
Regards,
Angelos
@JulienSchanen
Maybe a Macro is not necessary.