Whilst using Alteryx to restructure data, there may be times where you want to apply a formula across multiple columns simultaneously. Luckily for us, the software has a tool that handles this and below is a short example showing how we can apply this to save time when prepping.
For this demonstration, we'll be rounding each of the 'X Drug Price' columns to 2 decimal places and then multiplying them by 'AK Chance'; the logic for this can be seen in the 'Expression' box in the bottom left of the interface. Instead of going through and writing out a formula for every target column, we can tick them all in the 'Select x fields' section at the top and then use the generic '_CurrentFields_' measure to represent each of them in the formula. In this instance, we want to replace the original column and so haven't selected 'Copy Output Fields and Add' - if we were to do this then we would get a bunch of new columns at the end of our data set named 'New_X Drug Price', with the transformation applied.
Within the image above, you can see the data set after applying the MFF tool. The reason the values are not to 2 decimal places, as the expression suggests, is because they have each been multiplied by the 'AK Chance' following the rounding step. If we were to leave out this final part of the formula then we would get the results shown below.
Although this example has only shown rounding and multiplication, we can apply any function we want to columns of a similar nature. A list of these can be found within 'Functions' and then navigating to whichever you need. If required for the formula then we can also bring in measures from the 'Original Fields' dropdown, just like we did for 'AK Chance'. Finally, the data type of the output field can also be changed by ticking the 'Change Output Type to' box and then selecting the desired option.