Access Beginner
Active Member
- Joined
- Nov 8, 2010
- Messages
- 311
- Office Version
- 2016
- Platform
- Windows
Hello,
I have a list of dataset on a sheet called "DATA_HOLDINGS". This has columns of "libname","dataset","variable","type,"lenght" and "varnum". This list at the moment is 40,733 but will grow.
Under the column "dataset", there are dataset names with a list of variables for that dataset. The issue I have is that there are datasets that are exactly the same in terms of variables, but the datasets are
monthly eg. Dataset190710,Dataset190810.Dataset190910,Dataset191010 etc Each of these datasets will have the same variables. There are other datasets wich are monthly and these will have different variables.
Can someone please be able to create code so that a new sheet is created where a unqiue list of datasets are created,but still have all the "variable","type,"lenght" and "varnum"
.
Current Output
<tbody>
</tbody>
Expected Output
<tbody>
</tbody>
Some datsets have 2 years worth of monthly data. There will also be different libnames
I have a list of dataset on a sheet called "DATA_HOLDINGS". This has columns of "libname","dataset","variable","type,"lenght" and "varnum". This list at the moment is 40,733 but will grow.
Under the column "dataset", there are dataset names with a list of variables for that dataset. The issue I have is that there are datasets that are exactly the same in terms of variables, but the datasets are
monthly eg. Dataset190710,Dataset190810.Dataset190910,Dataset191010 etc Each of these datasets will have the same variables. There are other datasets wich are monthly and these will have different variables.
Can someone please be able to create code so that a new sheet is created where a unqiue list of datasets are created,but still have all the "variable","type,"lenght" and "varnum"
.
Current Output
libname | dataset | variable | type | length | varnum |
Lib1 | Dataset190710 | Variable1 | char | 30 | 1 |
Lib1 | Dataset190710 | Variable2 | char | 7 | 2 |
Lib1 | Dataset190710 | Variable3 | char | 1 | 3 |
Lib1 | Dataset190710 | Variable4 | char | 1 | 4 |
Lib1 | Dataset190710 | Variable5 | num | 8 | 5 |
Lib1 | Dataset190710 | Variable6 | char | 3 | 6 |
Lib1 | Dataset190710 | Variable7 | char | 3 | 7 |
Lib1 | Dataset190810 | Variable1 | char | 1 | 8 |
Lib1 | Dataset190810 | Variable2 | char | 3 | 9 |
Lib1 | Dataset190810 | Variable3 | num | 8 | 10 |
Lib1 | Dataset190810 | Variable4 | num | 8 | 11 |
Lib1 | Dataset190810 | Variable5 | char | 3 | 12 |
Lib1 | Dataset190810 | Variable6 | num | 8 | 13 |
Lib1 | Dataset190810 | Variable7 | char | 3 | 14 |
<tbody>
</tbody>
Expected Output
libname | dataset | variable | type | length | varnum |
Lib1 | Dataset190710 | Variable1 | char | 30 | 1 |
Lib1 | Dataset190710 | Variable2 | char | 7 | 2 |
Lib1 | Dataset190710 | Variable3 | char | 1 | 3 |
Lib1 | Dataset190710 | Variable4 | char | 1 | 4 |
Lib1 | Dataset190710 | Variable5 | num | 8 | 5 |
Lib1 | Dataset190710 | Variable6 | char | 3 | 6 |
Lib1 | Dataset190710 | Variable7 | char | 3 | 7 |
<tbody>
</tbody>
Some datsets have 2 years worth of monthly data. There will also be different libnames
Last edited: