Hi!
I am fairly new at Alteryx and I am playing with Macros. I have this dataset that I want to do a computation based on a excel configuration file. Basically, what it should do is from the formula written in an Excel file, the macro should compute all the necessary records based on the provided formula. However, I am having difficulty when the formula requires record that is not on the same row. You may see the table below as an example of my dataset.
Category | Code | Columns1 | Column1 | Column2 | VAT | Column/VAT | Columns2 | Column3 | Column4 | VAT2 | Column/VAT2 | % Spend | Spend Coverage |
TOTAL MIX | TOTAL | [I : Columns1] + [II : Columns1] | [I : Column1] + [II : Column1] | [I : Column2] + [II : Column2] | [I : VAT] + [II : VAT] | [I : Column/VAT] + [II : Column/VAT] | [I : Columns2] + [II : Columns2] | [I : Column3] + [II : Column3] | [I : Column4] + [II : Column4] | [I : VAT2] + [II : VAT2] | [I : Column/VAT2] + [II : Column/VAT2] | ||
TOTAL MIX | I | [IA : Columns1] + [IB : Columns1] + [IC : Columns1] | [IA : Column1] + [IB : Column1] + [IC : Column1] | [IA : Column2] + [IB : Column2] + [IC : Column2] | [IA : VAT] + [IB : VAT] + [IC : VAT] | [IA : Column/VAT] + [IB : Column/VAT] + [IC : Column/VAT] | [IA : Columns2] + [IB : Columns2] + [IC : Columns2] | [IA : Column3] + [IB : Column3] + [IC : Column3] | [IA : Column4] + [IB : Column4] + [IC : Column4] | [IA : VAT2] + [IB : VAT2] + [IC : VAT2] | [IA : Column/VAT2] + [IB : Column/VAT2] + [IC : Col umn/VAT2] | [Columns2] / [Columns1] | [I : Column/VAT2] / [TOTAL : Column/VAT2] |
TOTAL MIX | IA | [Column1] + [Column2] | 2 | 7 | 23 | [Columns1] + [VAT] | [Column3] + [Column4] | 11 | 15 | 19 | [Columns2] + [VAT2] | [Columns2] / [Columns1] | [IA : Column/VAT2] / [TOTAL : Column/VAT2] |
TOTAL MIX | IB | [Column1] + [Column2] | 3 | 8 | 24 | [Columns1] + [VAT] | [Column3] + [Column4] | 12 | 16 | 20 | [Columns2] + [VAT2] | [Columns2] / [Columns1] | [IB : Column/VAT2] / [TOTAL : Column/VAT2] |
TOTAL MIX | IC | [Column1] + [Column2] | 4 | 9 | 25 | [Columns1] + [VAT] | [Column3] + [Column4] | 13 | 17 | 21 | [Columns2] + [VAT2] | [Columns2] / [Columns1] | [IC : Column/VAT2] / [TOTAL : Column/VAT2] |
TOTAL MIX | II | [Column1] + [Column2] | 5 | 10 | 26 | [Columns1] + [VAT] | [Column3] + [Column4] | 14 | 18 | 22 | [Columns2] + [VAT2] | [Columns2] / [Columns1] | [II : Column/VAT2] / [TOTAL : Column/VAT2 |
The macro that I am playing with is a macro I found here in the community also but I just modified it to work with my dataset.
This is the screenshot of the macro:
This is what the macro can produce as of the moment. As you can see, it cannot compute for the last column as it requires record from other column that is not on the same row.
I attached the workflow below so it would be much easier to understand. Thank you for your help.