I need to pull information on one specific line out of many different files with a large amount of data in each.

Lurkily

New Member
Joined
Nov 30, 2011
Messages
22
Right now, I'm tracking property, and I do so using a script to download IT reports (produced weekly) and using PowerQuery to import these different data sets into one workbook. This allows me to enter the UID for an asset, or many assets, and get a report on all accessible data for the entries.

What I WANT to do is develop a new form structure that will only be useful for one asset, but dig into its' history by accessing multiple files. I have almost no experience with scripting, but I don't think this is something I can do with Power Query alone.

My file structure (for one of these four files) looks like this: (Yes, I know Y/M/D is weird, but it sorts chronologically in an alphabetical search, and that keeps my archive tidy.)
20230629 - Active Assets
20230622 - Active Assets
20230615 - Active Assets

The key that I will use to find the line with information I need is in the form of a serial code; sometimes entirely numerical, sometimes with some letters, but it should always be in a specific, expected column, and it will always be unique. For instance, the "Asset Tag" will always be in column B in the Active Asset files I used to demonstrate my naming convention.

And so on. As an FYI, the exact date and filenames are not predictable (not every 7 days exactly), so I can't rely on predicting the dates that will be used for the filenames.

I want to be able to enter the UID for an IT asset, and have it pull up what these files report for the four most recent files, and the first file that's at least 3, 6, 12, 18, and 24 months old.

As said, I have almost no experience with macros and scripting, and every time I try to use them it seems like a round of torture to make it work, even when they're pre-written by someone who knows better. But I'm also pretty sure that there isn't a way to get files in such a dynamic way via Power Query's stock features.

If anybody has an idea of how to solve this or a good idea where I should begin learning, I'd appreciate it. This feels like a much heavier lift than I could develop via scripting as a beginner.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I can't promise that I can do this but I'll try. If not me then possibly other people who are smarter about Excel.

If you want assistance you are more likely to get help if you help the helper. That way a helper does not need to guess about or to recreate your data.

If the data is not confidential hopefully you could post a link to your workbook. If necessary you can enter fake-but-realistic data before providing the link. Put the file on Dropbox, Box, 1Drive, Google Drive etc. Use the link icon above the message area. Make sure that other people can access the file!

Or, consider sharing relevant data using Mr Excel's excellent XL2BB addin that enables you to post a portion of a worksheet. See XL2BB - Excel Range to BBCode for details.
 
Upvote 0
Unfortunately, from work I both can't install plugins, and cannot access cloud services. Likewise I don't want to put information about our procurement online, and recreating fake data is onerous, just from the number of columns in it.

I would make a mock file for you, though, but I actually stumbled on something here: Create Dynamic File Path in Power Query - Goodly

It looks like you can get PowerQuery to look up the files present in a path; after that, it should be a matter of getting it to work on the nth file. It'll take a while to figure out, but I feel like I have a clear path to investigate.

If you'd like to pursue it for the challenge of it, the relevant parts can be replicated with a simple structure -- Columns "Asset Tag," "User," "Location," and "Last Login". "Asset Tag" is the Unique ID that I'll enter in my sheet.

My goal will be to enter one number in a tiny table just for that entry, and use a query to get the single matching entry from the first file, then the 7th file, 14th, 30th, 60th, 90th, 365th, 730th, and 1095th; build a profile of who was using it last, where and when, today, a week ago, two weeks, 1,2,3 months ago, 1,2,3 years ago.

I'm gonna be honest; it's not a tool I need a lot. But when I run out of work to do it keeps me busy, and it keeps me learning.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top