Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

batch macro to apply modifications

JulienSchanen
5 - Atom

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 

IDTrainingUsernameField to modifyModification
1Training 1User 1Hours4.00
2Training 2User 2TypeC
3Training 1User 1TypeC

 

Dataset 

TrainingUsernameNameHoursDateType
Training 1User 1XXXX2.002020-12-31C
Training 1User 1XXXX1.002020-12-31D
Training 2User 1XXXX2.002020-12-31D
Training 1User 1XXXX4.002020-12-31D
Training 2User 2YYYY4.002020-12-31D
Training 2User 2YYYY2.002020-12-31C

 

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

 

2 REPLIES 2
AngelosPachis
16 - Nebula

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.

 

AngelosPachis_0-1609109316497.png

 

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

Qiu
20 - Arcturus
20 - Arcturus

@JulienSchanen 
Maybe a Macro is not necessary.

1228-JulienSchanen.PNG

Labels