Skip to content

Instantly share code, notes, and snippets.

Lars Schreiber SchreiberLars

Block or report user

Report or block SchreiberLars

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fnImportCSVsWithDifferentStructure.pq
let func = (PfadZumOrdner as text, Spaltentrennzeichen as text, EncodingCode as number ) as table =>
let
//Hier den Funktions-Corpus eintragen
//=========================================Beispielparameter fürs Debugging====================================
/*PfadZumOrdner = "H:\SSBI-Blog\Website\Business Topics\_csvs mit verschiedenen Headern einlesen\Datenquelle",
Spaltentrennzeichen = ";",
EncodingCode = 1252
*/
//=========================================Beispielparameter fürs Debugging==================================== */
View fnGetDeutscheFeiertageJeBundesland
let func = (Kalenderjahr as number) as table =>
let
//Liste aller Bundeländer für den Aufbau der URL bei arbeitstage.org
List_Bundeslaender = {
"baden-wuerttemberg",
"bayern", "berlin",
"brandenburg",
"bremen",
"hamburg",
"hessen",
View fnReturnCustError.pq
(IDCustErr as number)=>
let
//IDCustErr = 5, /* for debugging purposes */
// ============ START: Define your list of custom error records here ====================
ListCustomErrors = {
//Custom error #1: The only permissible tax rates are as follows 7% and 19%
[
CustErrID = 1,
reason ="Illegal tax rate",
View fnUTC2Local.pq
(DateTimeUTC as datetime) as datetime =>
let
/*
================================================================================
Wesentliche Bestandteile der Funktion basieren auf der Arbeit von 'Frank Tonsen'
================================================================================
*/
Year = Date.Year(DateTimeUTC),
//Ermittlung der Grenze der Winterzeit --> letzter Sonntags im März, 00:59:59 Uhr UTC
View fnRelativerSpaltenvergleich.pq
let
/*
Beginn der Funktionsdefinition, mit Funktionsnamen, Funktionsparametern und Typ des Funktionsrückgabewertes
*/
fnInsertDiffColumn = (ColumnName as text, MyTable as table) as table =>
let
/*
Parameter für das Testen der Funktion, während der Entwicklungsphase
*/
/*
View fnGeschaeftsHalbjahr.pq
let
fn = (MyDate as date, StartMonat as text) =>
let
Startmonatsnummer =
List.PositionOf(
{"januar", "februar","märz","april","mai","juni", "juli", "august", "september", "oktober", "november", "dezember"},
Text.Lower(StartMonat)
) + 1,
Offset = Startmonatsnummer -1,
AtuellerKalendermonat = Date.Month(MyDate),
View fnGeschaeftsHalbjahrUndJahr.pq
let
fn = (MyDate as date, StartMonat as text) =>
let
Startmonatsnummer =
List.PositionOf(
{"januar", "februar","märz","april","mai","juni", "juli", "august", "september", "oktober", "november", "dezember"},
Text.Lower(StartMonat)
) + 1,
Offset = Startmonatsnummer -1,
AtuellerKalendermonat = Date.Month(MyDate),
View fnGeschaeftsQuartalUndJahr.pq
let
fn = (MyDate as date, StartMonat as text) =>
let
Startmonatsnummer =
List.PositionOf(
{"januar", "februar","märz","april","mai","juni", "juli", "august", "september", "oktober", "november", "dezember"},
Text.Lower(StartMonat)
) + 1,
Offset = Startmonatsnummer -1,
AtuellerKalendermonat = Date.Month(MyDate),
View fnGeschaeftsQuartal.pq
let
fn = (MyDate as date, StartMonat as text) =>
let
Startmonatsnummer =
List.PositionOf(
{"januar", "februar","märz","april","mai","juni", "juli", "august", "september", "oktober", "november", "dezember"},
Text.Lower(StartMonat)
) + 1,
Offset = Startmonatsnummer -1,
AtuellerKalendermonat = Date.Month(MyDate),
View fnGeschaeftsMonatUndJahr.pq
let
fn = (MyDate as date, StartMonat as text) =>
let
Startmonatsnummer =
List.PositionOf(
{"januar", "februar","märz","april","mai","juni", "juli", "august", "september", "oktober", "november", "dezember"},
Text.Lower(StartMonat)
) + 1,
Offset = Startmonatsnummer -1,
AtuellerKalendermonat = Date.Month(MyDate),
You can’t perform that action at this time.