Hi all,
I'm trying to create an Alteryx macro that does the following:
1. Allow users to select columns to apply formula on - this is important as the variables selected will differ greatly from case to case
2. Apply formula on selected columns
3. Rename selected columns
4. Allow users to choose what aggregation method to use
I've looked up a lot of material on creating macros, but I can't seem to get step 1 and step 4 to work correctly. I've attached a sample packaged workflow that does what the macro should do. Please note that all data and formula included are made up for privacy reasons. The attached workflow includes the following:
1. ID for a hospital
2. ID for locations near the hospital
3. Total Population at location
4. Median Income at location
5. Average Income at location
For the purposes of this exercise, total population, median income, and average income are the only variables selected, but depending on use case, a user could select many, many more variables (such as income breakdown by gender, expenditure on rental equipment, etc..). I want to create a macro that:
1. First prompts the user to select columns they want to apply weights on
2. Creates new columns that include the weighted values for selected columns
3. Rename the weighted values column as = 'weights_variable name' - so if the user applied a weight of 0.8 to total population, the weighted column would be - '0.8_TotalPopulation'
4. Allows the user to select aggregation method for each of the columns. In this example, the user would want to group by hospital id, sum total population, find the median of the median income, and the average of the average income.
Please let me know if something like this is possible. Thank you very much!
User | Count |
---|---|
106 | |
82 | |
70 | |
54 | |
40 |