kiaragrouwstra / pquery Goto Github PK
View Code? Open in Web Editor NEWA collection of functions for use in Excel Power Query
License: MIT License
A collection of functions for use in Excel Power Query
License: MIT License
I've found it very useful!
Thanks a lot!
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
Have you guys considered coming up with a folder structure for all of these functions? I was discouraged to check on the project details just because the descriptions of this repo are way down at the bottom.
I found that for me copying queries from file to file is much more convenient than using Load function. I think that I'm not alone here. So I suggest to create a release in this repository with xlsx file, that would contain all the functions from the repository in it. I believe that it can help the distribution of pquery functions!
I forked the project to create a release, but I didn't find any way to create a pull request with this release. So I ask @tycho01 to use his file, or to use mine from the link:
https://github.com/power-bi/pquery/releases/latest
Hello I've made a little modification in the function "Text.ContainsAny" to get a index from a list.
My doubt is how could I stop the List.Generate when I found a true value in "Text.Contains(str,needles{[i]})" ?
//Text.ContainsAny
(str, needles) as any =>
let
needles = List.Buffer(needles),
count = List.Count(needles),
break = 0
in
let
idx =
List.PositionOf(
List.Generate(
()=>[i=0],
each [i] < count,
each [i=[i]+1],
each Text.Contains(str,needles{[i]})
),
true
),
output = if idx < 0 then null else needles{idx}
in
output
Doesn't work, json error
Very simple, need to rename List.Zip to List.Zip2 or something similar.
There is a problem (bug?) in PQ around re-using function argument names on local variables (immutable though they are) within the function. This is not a problem if you invoke directly, but if you are invoking as a parameter in a host function, the above error is thrown. The problem occurs in...
Value.ToText
Type.ToText
Value.TypeToText
All of these have an optional argument signifying recursive types and the same name is recycled in the function body. Simply change the name of the local variable and all is OK.
e.g. in Value.TypeToText
change Recurs
to _Recurs
let
Source = (Value as any, optional Recurs as logical) as text =>
let
Recurs = if (Recurs<>null) then Recurs else false,
Type.ToText = #"Load"("Type.ToText"),
Type = Value.Type(Value),
ToText = if Value.Is(Value, type type) and Recurs then
"type " & Type.ToText(Value, Recurs)
else
Type.ToText(Type, Recurs),
Return = ToText
in Return
in
Source
To
(Value as any, optional Recurs as logical) as text =>
let
_Recurs = if (Recurs<>null) then Recurs else false,
Type.ToText = Load("Type.ToText"),
Type = Value.Type(Value),
ToText = if Value.Is(Value, type type) and _Recurs then
"type " & Type.ToText(Value, _Recurs)
else
Type.ToText(Type, _Recurs),
Return = ToText
in Return
Took me a while to figure this out but, much shorter than writing it myself: thanks for the share!
I won't be using the dynamic loading, but it's the closest I've seen to a build tool in PQ.
It seems that #shared cannot be refreshed on Power BI service. It there is no workarounds, it means, that you cannot upload model from a workbook to Power BI and refresh it.
Setting off "Include in report refresh" in Power BI doesn't work in Power BI service.
It would be worth to mention that in the documentation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.