Hi - I'm an inexperienced user of Alteryx and looking to solve a problem related to creating a data table from existing data to show monthly values.
I have a table containing the following
Date of Run
Agreement ID
Variable 1 Value
I want to report month end values for each agreement for the variable, however not all records have a value that will change each month, so I could have a table which looks like this:
| Run date | Record ID | Value 1 |
| 10/01/2019 | 22 | 10 |
| 20/02/2019 | 22 | 20 |
| 30/04/2019 | 22 | 21 |
| 03/07/2019 | 22 | 15 |
| 02/01/2019 | 31 | 11 |
| 21/01/2019 | 31 | 9 |
| 30/01/2019 | 31 | 7 |
| 04/07/2019 | 31 | 22 |
I want however to end up with a table that presents that data as follows:
| Date | Record ID | VALUE 1 |
| 31/01/2019 | 22 | 10 |
| 31/01/2019 | 31 | 7 |
| 28/02/2019 | 22 | 20 |
| 28/02/2019 | 31 | 7 |
| 31/03/2019 | 22 | 21 |
| 31/03/2019 | 31 | 7 |
| 30/04/2019 | 22 | 21 |
| 30/04/2019 | 31 | 7 |
| 31/05/2019 | 22 | 21 |
| 31/05/2019 | 31 | 7 |
| 30/06/2019 | 22 | 21 |
| 30/06/2019 | 31 | 7 |
So the reporting date will always be the last day of the month
I can do this manually by creating (in this example) 6 queries which select all records with a run date before the relevant reporting date, and sorting so that where there are 2 or more changes in the month, the 1st record is always the latest. Using Unique for Record ID I can then deliver 6 outputs which I can then combine into a single table (at the moment in Excel)
I figure there has to be a way of running it as a macro and delivering a table with columns for reporting date, Record ID and each variable
There are actually 20 variables which is why the output table is arranged as it is, and I'm intending to show each column as a different variable
Can anyone provide me a sample workflow to show how the macro would work ? or a better way of doing it
Thanks