Coding for **By trial group (folder average)**

Thank you Francois - I think the first option sounds more reasonable for my situation.

Based on your recommendation this is what I've done so far.

  1. Included the following under %%GET DESCRIPTION to keep all the possible options available for avgtype.
    image

  2. Added the following code based on your suggestion. This is just before where all the calculations take place (i.e. my custom code). I understand that selecting a specific avgtype will give a "value" output which "sProcess.options.avgtype.Value" will use to decide what kind of avgtype to run.

Is this what you had in mind? Can you see any issues?
I was not sure where and how to include the "code" you adapted.
You wrote in your comment "% Your code" so I assumed my code should be inserted between the "for" and "end".