-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chaining M folder functions #7
Comments
I'm not actually sure you'd need any of my functions here. To parameterize your queries so you could use them on multiple files, make them into functions. i.e. from: This yields a reusable function that you can then reuse with: Ehren in that thread was correct; for the purpose of getting the info into tables for the Data Model, one query would be expected to output one table.
The problem is though, since PowerPivot will want separate tables, if you're doing this you'd again need separate queries to separate these results back. Which begs the question, why even bother in the first place. Which brings me back to your aversion to multiple queries, as Ehren did. You hadn't responded to her anymore -- I presume the refreshing isn't an issue? Feel free to clarify further. |
Refreshing is not an issue. Thank you for taking the time to respond, very much appreciated. I am open to suggestion and not averse to any methodology as relatively new to powerquery although not to Excel. In my assumption and reading your post above I think you have solved the problem largely. So if I have a folder of 50 xml files and I process the queries as
I would end up with 4 tables all filled with the respective data from the 50 files and as long as the relationship in my data model are correct then it will work? |
One approach: have that function, iterate over it for all files in a new query, so as to obtain a List of Records (or, a Table), then have four more queries pick out those respective parts out (merging results per file into one and the same table) for separate consumption by PowerPivot. Another approach: for each of your four result types, make a query iterating over your files and extracting one piece of info, optionally splitting out the extraction logic into a resuable function. Ultimately, approach #1 may not justify the complication it adds, which involves (if you must):
If you're interested, I'd recommend using the language reference and formula reference for looking things up, but feel free to follow up with further questions. |
Thank you for the references. Not sure which route i will take, however sure to learn either way. |
Can I ask for help, Ehren and i cannot solve the question https://social.technet.microsoft.com/Forums/en-US/1d31402b-b05a-4091-8ce9-930481c34f93/combine-4-xml-queries-on-same-source-to-be-a-global-folder-query?forum=powerquery I chained the functions as you discussed above however I am unable to run the query on a folder.
Or
Seems as though I thought what I was doing was a good simple starting project hasn't worked that way. To clarify as there are multiple tables in my XML they cannot be resolved in one query so I create a query for each one. Now I wanted to chain them together so that they would run at once on a folder of XML files and return the results to a sheet for each query. |
As mentioned above Ehren is correct the data model wants functions to output one table.
|
I have been to the reference online, can i ask you straight though i thought this task simple in scope is it beyond M and PowerQuery current capability? Seems if i did this i would be the first based on internet searches, the msin similar example being xsv which is much easier. |
I have no desire for 4 just seems most logical way to handle related data tables |
It's not beyond it; use |
Thanks |
Hi
I want to be able to chain 4 functions together that will be used to import xml files from a folder. It is the same file each query on a table in the file.
Which function in the repository is best for chaining the execution of M functions.
This is my thread where i was referred here as s last possible chance to get it working https://social.technet.microsoft.com/Forums/en-US/1d31402b-b05a-4091-8ce9-930481c34f93/combine-4-xml-queries-on-same-source-to-be-a-global-folder-query?forum=powerquery
The text was updated successfully, but these errors were encountered: