Forum Discussion
Previous month data and Current month data as Two separate tables
Hello,
I don't think that the data itself is necessary. Also, its very sensitive data, so I've sponged it a lot. This probably does not help, but you can use any data you want, to reiterate, I am looking to pull this data from a Database and have two instances of it. One instance that has data from a previous month and one that has data from the current month. So the table below would be this months data, and previous months data would be the same except Last Seen would be from 5/8/2022.
| I.D. | Operating System | IP | Type | Category | Status | First Seen | Last Seen |
| 1 | Redhat | null | Server | Recurring | Active | 1/5/2022 | 6/8/2022 |
| 2 | Windows | null | Server | Recurring | Active | 1/6/2022 | 6/8/2022 |
| 3 | Windows | null | Server | Recurring | Active | 1/5/2022 | 6/8/2022 |
| 4 | Redhat | null | Server | Complete | Active | 1/6/2022 | 6/8/2022 |
| 5 | CentOS | null | Server | Recurring | Active | 1/6/2022 | 6/8/2022 |
| 6 | Redhat | null | Server | Recurring | Active | 1/5/2022 | 6/2/2022 |
| 7 | Windows | null | Server | Recurring | Active | 1/6/2022 | 6/8/2022 |
| 8 | Windows | null | Server | Recurring | Active | 1/6/2022 | 6/8/2022 |
| 9 | Redhat | null | Server | Recurring | Inactive | 1/5/2022 | 6/5/2022 |
| 10 | CentOS | null | Server | Complete | Inactive | 1/6/2022 | 6/8/2022 |
My idea was to create a separate blank query (Prev Table) that copies the Main tables data. So when it comes time to pull in the new data, I would refresh the Prev Table to pull the data that is currently in the Main table that is currently out of date, then I would refresh the main table to pull in this months new data.
Another idea was possible a history table with summarized data? So I would create a new table that captured the current month that its capturing, sum of total rows in this months, and number of active servers (This is ultimately the data I need for the metrics). And with every refresh it would add in a row or at the very least, from the previous month.