It’s Power Query M Let’s have some fun!

Slides:



Advertisements
Similar presentations
1 Scheme and Functional Programming Aaron Bloomfield CS 415 Fall 2005.
Advertisements

1 Compiler Construction Intermediate Code Generation.
Racket Introduction CSC270 Pepper major portions credited to
Chapter 4B: More Advanced PL/SQL Programming
Lecture 3: Topics If-then-else Operator precedence While loops Static methods Recursion.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
ALBERT WAVERING BOBBY SENG. Week Whatever: PHP  Announcements/questions/complaints.
JSP Standard Tag Library
Rationale Aspiring Database Developers should be able to efficiently query and maintain databases. This module will help students learn the Structured.
Using Visual Basic 6.0 to Create Web-Based Database Applications
NMED 3850 A Advanced Online Design January 26, 2010 V. Mahadevan.
Chapter 10: BASH Shell Scripting Fun with fi. In this chapter … Control structures File descriptors Variables.
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
Access Queries Agenda 6/16/14 Review Access Project Part 1, answer questions Discuss queries: Turning data stored in a database into information for decision.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 FP Foundations, Scheme In Text: Chapter Chapter 14: FP Foundations, Scheme Mathematical Functions Def: A mathematical function is a mapping of.
1 Stored Procedures in MySQL Part I. 2 Objectives SQL Vs. MySQL SP MySQL SP Parameters MySQL SP Control Structures.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
.NET MCQs MULTIPLE CHOICE QUESTION
PHP LANGUAGE MULTIPLE CHOICE QUESTION SET-5
PowerShell for the DBA: Why I love my inner pig-dog
The language focusses on ease of use
Introduction to Dynamic Web Programming
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Chapter 4 The If…Then Statement
Data Virtualization Tutorial: Introduction to SQL Script
A basic tutorial for fundamental concepts
Bridging the Data Science and SQL Divide for Practitioners
Solving the Hard Problems
CS 326 Programming Languages, Concepts and Implementation
Functional Programming
Welcome! Power BI User Group (PUG)
PHP Training at GoLogica in Bangalore
Searching Business Data with MOSS 2007 Enterprise Search
SQL Server Integration Services
BASIC PHP and MYSQL Edward S. Flores.
Error Handling Summary of the next few pages: Error Handling Cursors.
Automating the testing of BI Solutions wih NBi
Microsoft Access Illustrated
Searching Business Data with MOSS 2007 Enterprise Search
Racket Introduction CSC270 Pepper
Database Code Management with VS 2017 and RedGate
Populating a Data Warehouse
Populating a Data Warehouse
Query Optimization Techniques
Building a data connector for Power BI
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Populating a Data Warehouse
FP Foundations, Scheme In Text: Chapter 14.
PHP.
Automating the testing of BI Solutions wih NBi
Web DB Programming: PHP
Testing a persistence layer
Unit 3 Test: Friday.
2010 Microsoft BI Conference
Fundamentals of Functional Programming
Tutorial 6 PHP & MySQL Li Xu
Compiler Construction
Playing with (M)agic: Introduction to Writing M Code in Power BI
SSIS Data Integration Data Warehouse Acceleration
SSIS Data Integration Data Warehouse Acceleration
Bob Duffy 22 years in database sector, 250+ projects
SSRS – Thinking Outside the Report
Compiler Construction
DEV2DEV Performance tips for faster SQL queries
SSIS Data Integration Data Warehouse Acceleration
Improving the Performance of Functions
Learning Python 5th Edition
Presentation transcript:

It’s Power Query M Let’s have some fun! Cédric L. Charlier @Seddryck

Sponsors help us to run this event! THX! You Rock! Sponsor Gold Sponsor Silver Sponsor Bronze Sponsor

You Rock! Sponsor Session 13:45 Track 1 „Das super nerdige Solisyon Film- und Serienquiz“

Save the date for exiting upcoming events PASS Camp 2017 Main Camp 05.12. – 07.12.2017 (04.12. Kick-Off abends) Lufthansa Training & Conference Center, Seeheim SQL Konferenz 2018 PreCon: 26.02.2018 MainCon: 27.02. – 28.02.2018 Darmstadtium, Darmstadt More information at PASS booth

Open-sources contributions Skills & Interests Cédric L. Charlier @Seddryck In a nutshell Database architecture Data modeling Business intelligence Data warehousing ETL Olap/Tabular No SQL Big data Data analysis Machine learning seddryck.wordpress.com Data & BI architect Agile data warehouse Quality-oriented Automation fanboy Open-sources contributions Testing framework for BI www.nbi.io Other projects on github Deployment SSRS – RsPackage TmBundle for a few languages Starting SSIS from .Net - Cassis Toolset for special cases of modeling: ERMine et Tibre And much more Recognitions Microsoft MVP Data Platform award Agile leader of the month Experience 15 years with SQL Server Former consultant, working internally for Elia

Agenda How to be boring … Decode the fun with the html characters Error handling … keep smiling! “Do something while” does not exist Doing the L(augh) of ETL (no kidding) Metadata freedom !!! Frankly, I can’t remember why I selected this session

Programming paradigm Functional language Declarative (expressions not statements) Languages: Lisp, Scheme, Clojure, Erlang, Haskell, F# DSL: R, XQuery/XSLT, (SQL and Lex/Yacc) Extensions: Java, C#, PHP, Julia

Benefits of functional languages Evaluation of mathematical functions Avoids changing-state and mutable data No local or global state No side effect Output only depends on the arguments passed to this function

Expressiveness of a functional language C# (imperative way) Elixir (functional way) static int Fibonacci(int n) { int a = 0; int b = 1; int c = 0; if (n != 1) { for (int i = 1; i <= n; i++){ c = a + b; a = b; b = c; } return a; } else { return 1; } defmodule Fibonacci do def fib(0), do: 0 def fib(1), do: 1 def fib(n), do: fib(n-1) + fib(n-2) end

Values, list, records and tables 123 // A number true // A logical "abc" // A text null // null value #duration (0,1,30,0) {123, true, "A"} // list {1, 2, 3} {1, 3..7, 9} //list with values 1, 3, 4, 5, 6, 7, 9 #table( {"A", "B"}, { {1, 2}, {3, 4} } ) [ A = 1, B = 2, C = 3 ] // a record

Positional index operator Nested records [ Sales = [ FirstHalf = 1000, SecondHalf = 1100 ], Total = Sales[FirstHalf] + Sales[SecondHalf] ] [ Sales = { [ Year = 2007, Total = 2100 ], [ Year = 2008, Total = 2500 ] }, TotalSales = Sales{0}[Total] + Sales{1}[Total] // 4600 ] Lookup operator Positional index operator

Function and evaluation [ A1 = A2 * 2, A2 = A3 + 1, A3 = 1 ] Equivalent to A1 = 4, A2 = 2, (x, y) => (x + y) / 2 Parameters between brackets Symbol => to separate declaration and implementation Lazy evaluation of function Persistence of evaluation

The standard library More than 500 predefined functions: Manipulate values Number.E, TextPositionOf(“Hello”, “ll”) Modify lists, records and tables List.Transform(…) Record.FieldCount() Table.AddColumn(…) Access data sources Sql.Database(…) Web.Contents(…)

each Simplified declaration – function taking a single parameter “_” (underscore) each _+1  (_) => _ + 1 each [A]  (_) => _[A] Table.SelectRows(t, each [Weight]>12)  Table.SelectRows(t, (x) => x[Weight]>12)

Power Query editor “Advanced editor” Notepad++ Visual Studio and Power Query SDK

The secret of being boring is to say everything Voltaire

Demo (live coding) Create a list with 5000 elements from 1 to 5000 Create a record by adding a second field with random value How-to Each keyword Persistence of evaluation

Agenda How to be boring … Decode the fun with the html characters Error handling … keep smiling! “Do something while” does not exist Doing the L(augh) of ETL (no kidding) Metadata freedom !!!

If … then … else Select between two expressions Based on a logical condition else is not facultative But you can explicitly inform that this path is not implemented by using an ellipsis (…) if a<b then a+2 else …

Demo: parse some html characters Encoded with pattern &#number; First iteration: Only 1 special char by word No error Expl: Cédric is translated to Cédric

Agenda How to be boring … Decode the fun with the html characters Error handling … keep smiling! “Do something while” does not exist Doing the L(augh) of ETL (no kidding) Metadata, freedom !!! I’ll introduce you to the Power Query M language. But first take a minute to say goodbye to your friends and family!

Handling errors Functions can return errors 0/0 Use try … otherwise … to handle them You can create your own errors with error “my message” And check them with x[HasError] and x[Error]

A challenge Parse movie title and extract production’s year The Shawshank Redemption (1994) My Dad Says (2010) {Dog Ed (#1.7)} Years Younger (2004/I) abcd(19xy) hqskj dhq (2020) fdsdf (1995) sdfsdf (19)

Agenda How to be boring … Decode the fun with the html characters Error handling … keep smiling! “Do something while” does not exist Doing the L(augh) of ETL (no kidding) Metadata freedom !!!

Recursive function Scoping operator “@” (arrobas) [ Factorial = (x) => if x = 0 then 1 else x * @Factorial(x - 1), Result = Factorial(3) // 6 ]

Demo: back to the html characters Encoded with pattern &#number; Second iteration: None or many special chars in a word Expl: Hélène is translated to Hélène Alice is translated to Alice Clémence is translated to Clémence

Agenda How to be boring … Decode the fun with the html characters Error handling … keep smiling! “Do something while” does not exist Doing the L(augh) of ETL (no kidding) Metadata freedom !!!

Using data source access Standard library includes methods to access data sources Sql.Database lets you run a query on a database Usually it’s a SELECT but could be INSERT or UPDATE

Demo Manage customers: Update “Age” Insert new customers

Agenda How to be boring … Decode the fun with the html characters Error handling … keep smiling! “Do something while” does not exist Doing the L(augh) of ETL (no kidding) Metadata, freedom !!!

Metadata Information associated to a value Presented as a record Assign "Mozart" meta [ Rating = 5, Tags = {"Classical"} ] Retrieve Value.Metadata( "Mozart" )

Demo Retrieve content of a website Handling not existing/available website

Don‘t forget ... After-Show-Party!!! 5 Jahre SQL Saturday an der Hochschule Bonn-Rhein-Sieg SQLSat Bruzzler - Grillparty Würstchen & Bier ab ca. 19.00 Uhr am Ende der Hochschulstraße

Sponsors You Rock! Sponsor Gold Sponsor Silver Sponsor Bronze Sponsor