Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ImkeF's full-sized avatar

Imke Feldmann ImkeF

View GitHub Profile
@Hugoberry
Hugoberry / MatrixMultiplication.m
Last active January 29, 2018 14:59
Matrix Multiplication in Power Query M. Test example = MatrixMultiplication(#table({"A","B"},{{1,2},{3,4}}), #table({"A","B"},{{1,2},{3,4}}))
(A,B) =>
let
//vector multiplication
dotProduct = (v1,v2) =>
List.Accumulate(
List.Zip({v1,v2}),
0,
(agg,_)=>
agg+(_{1}*_{0}))
@tonmcg
tonmcg / Html.GetTables.pq
Last active May 14, 2018 19:13
M Language Helper Functions for HTML Parsing
let GetTables =
(url as text) =>
let
DOM = Text.FromBinary(Web.Contents(url)),
DOCTYPE =
let
DOCTag = "<!" & Text.BetweenDelimiters(DOM, "<!", ">") & ">"
in
DOCTag,
HTMLOpeningTag =
@ImkeF
ImkeF / ComplexJsonRecord.pq
Last active November 19, 2019 11:44
TheBIccountant
(URL as text) =>
let
MyJsonRecord = Json.Document(Web.Contents(URL)),
MyJsonTable= Table.FromRecords( { MyJsonRecord } )
in
MyJsonTable
@IvanBond
IvanBond / GetUsername.pq
Created June 8, 2019 13:45
Get USERNAME in Power Query
let
Source = Folder.Contents("C:\Users"),
// filter out Public folder as it may be accessed by scripts
#"Filtered out Public" = Table.SelectRows( Source, each [Name] <> "Public"),
// sort to get last accessed in the top row
#"Sort by Date accessed" = Table.Sort( #"Filtered out Public", {{"Date accessed", Order.Descending}}),
// filter out potential system folders
#"Expanded Attributes" = Table.ExpandRecordColumn(#"Sort by Date accessed", "Attributes",
{"Kind", "ReadOnly", "Hidden", "System"},
{"Kind", "ReadOnly", "Hidden", "System"}),
@kucukharf
kucukharf / Finance.excel.rate.js
Last active February 23, 2024 08:42
Excel RATE() Javascript Function
/*!
* @fileOverview Finance Excel Rate Formula Javascript Equivalent
* @version 1.0.0
*
* @author Burak Arslan @kucukharf http://www.github.com/kucukharf
* @license
* Copyright (c) 2010-2018 Burak Arslan
* Licensed under Creative Commons (CC) license
* @usage RATE($periods, $payment, $present, $future, $type, $guess)
*/