Forum Discussion
Power Query Editor Transform file helper Query folders
and stuff that into a function.
this is confusing me. i dont know what this part means. I know I can click a Query and Create function but I dont know how this all works with the given logic unfortunately
Im starting to wonder if this isnt too big and complex a job because I have a lot of queries to change
Ingest = (Binary)=> Table.PromoteHeaders(Csv.Document(Binary), [PromoteAllScalars=true])
As you know each step in Power Query has a name. You can refer to the step in subsequent steps by using that name.
Here we create a step that is arbitrarily called "Ingest". Then we provide an argument (Binary) which transforms that step to a function. "=>" completes the function header. After that you can have any number of steps that can eventually return someting. In this case what is returned is the CSV interpretation of the function argument, with the headers already promoted. We need the headers later so we can then combine/append the results correctly.
Instead of nesting the instructions you can go through the whole let ... in ... syntax if that's more relatable. And you can also place the function outside this code. There are many ways to do this, and ultimately it is down to personal preference.
- DebbieE3 years agoCommunity Champion
Sorry i cant do that its not my data.
Hopefully this walk through gives me what I need https://youtu.be/6cGou1-1FOo
- DebbieE3 years agoCommunity Champion
I will try and read through it all again but I fear Im not understanding this. Thats for trying though.
- DebbieE3 years agoCommunity Champion
Unfortunately this is not working for me
"Click the first Binary link. That ingests the CSV
and already promotes the headers"
It doesnt do this. You have to click the arrows on the data column to bring through the data atfter clicking on Binary. And you have to do the column promotion youself.
the other thing it doesnt bring through because you are clicking on one file only is the actual file name.
Has anyone got another option I can use that will bring through the filr name. Which is what happens when you filter for the foles and then click on content to bring both files through?
- lbendlin3 years agoSuper User
Please provide a couple of sample CSV files (with the same structure).
- DebbieE3 years agoCommunity Champion
Yes, this video works a treat