Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi everyone,
Hi @smpa01 , thank you for your advice. I'm good with using Javascript if I can use Google Analytics and SQL as the data sources, since I need to parse URL from multiple web pages (same domain, different sites) that follow the above format I have mentioned above. I did read through your posted articles but find it hard to follow the steps outlined.
Thank you @smpa01 ! The format of this URL column in a table imported from Google Analytics. I'm also not familiar with JSON and just need the regex syntax so I can put this into R script.
@Anonymous I meant js(javascript) and not JSON. Since I found out about the native capacity, I have not been using stringR anymore. I am sorry, someone else will help you.
@Anonymous js and regex can be natively written in PQ now.
In this case, you only want the string that has a total forwardslash count=6 which you can write by writing js and combining regex in it
var x='"&input&"';
var b = (x.match(/\//gm)).length;
document.write(b)
The full code
let
fx=(input)=>
Web.Page(
"<script>
var x='"&input&"';
var b = (x.match(/\//gm)).length;
document.write(b);
</script>"){0}[Data]{0}[Children]{1}[Children]{0}[Text],
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WKkhMT9VLzs/Vz0nMSy8FchQ0UvMU8osU0oo09ZPz80pS80riSyoLUvWTE0tS0/OLKvWLS5Pg7MrUxCKYMqVYHbLMI1cfsjvINQPkfqXYWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Filtered Rows" = Table.SelectRows(Source, each (fx([Column1]) = "6"))
in
#"Filtered Rows"
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |