SlideShare a Scribd company logo
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
In a nutshell
Open-sources
contributions
Skills &
Interests
Recognitions
 Agile data warehouse
 Quality-oriented
 Automation fanboy
 Microsoft MVP Data
Platform award
 Agile leader of the month
 Database architecture
 Data modeling
 Business intelligence
 Data warehousing
 ETL
 Olap/Tabular
 No SQL
 Big data
 Data analysis
 Machine learning
 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
Experience
 15 years with SQL Server
 Former consultant, working
internally for Elia
Cédric L. Charlier
@Seddryck
seddryck.wordpress.com
Data & BI architect
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)
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;
}
}
Elixir (functional way)
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
[
A = 1,
B = 2,
C = 3
] // a record
#table(
{"A", "B"},
{
{1, 2},
{3, 4}
}
)
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
• Parameters between
brackets
• Symbol => to separate
declaration and
implementation
• Lazy evaluation of function
• Persistence of evaluation
(x, y) => (x + y) / 2
[
A1 = A2 * 2,
A2 = A3 + 1,
A3 = 1
]
Equivalent to
[
A1 = 4,
A2 = 2,
A3 = 1
]
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&#233;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&#233;l&#232;ne is translated to Hélène
Alice is translated to Alice
Cl&#233;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

More Related Content

What's hot

Good functional programming is good programming
Good functional programming is good programmingGood functional programming is good programming
Good functional programming is good programming
kenbot
 
Lisp
LispLisp
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
fanf42
 
Strong typing : adoption, adaptation and organisation
Strong typing : adoption, adaptation and organisationStrong typing : adoption, adaptation and organisation
Strong typing : adoption, adaptation and organisation
Damien Seguy
 
Introduction to Programming in LISP
Introduction to Programming in LISPIntroduction to Programming in LISP
Introduction to Programming in LISP
Knoldus Inc.
 
Lisp
LispLisp
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)
mircodotta
 
2 Years of Real World FP at REA
2 Years of Real World FP at REA2 Years of Real World FP at REA
2 Years of Real World FP at REA
kenbot
 
Crystal: tipos, peculiaridades y desafios
Crystal: tipos, peculiaridades y desafiosCrystal: tipos, peculiaridades y desafios
Crystal: tipos, peculiaridades y desafios
Brian Cardiff
 
Programming for Problem Solving Unit 1
Programming for Problem Solving Unit 1Programming for Problem Solving Unit 1
Programming for Problem Solving Unit 1
Dhiviya Rose
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphs
andyseaborne
 
Strong typing @ php leeds
Strong typing  @ php leedsStrong typing  @ php leeds
Strong typing @ php leeds
Damien Seguy
 
Lisp and scheme i
Lisp and scheme iLisp and scheme i
Lisp and scheme i
Luis Goldster
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
mircodotta
 
Introduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicIntroduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogic
SmartLogic
 
Functions, List and String methods
Functions, List and String methodsFunctions, List and String methods
Functions, List and String methods
PranavSB
 
Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Property-based testing of XMPP: generate your tests automatically - ejabberd ...Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Mickaël Rémond
 
Swift Reversing by Ryan Stortz
Swift Reversing by Ryan StortzSwift Reversing by Ryan Stortz
Swift Reversing by Ryan Stortz
Shakacon
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
SAMIR BHOGAYTA
 
Dr archana dhawan bajaj - c# dot net
Dr archana dhawan bajaj - c# dot netDr archana dhawan bajaj - c# dot net
Dr archana dhawan bajaj - c# dot net
Dr-archana-dhawan-bajaj
 

What's hot (20)

Good functional programming is good programming
Good functional programming is good programmingGood functional programming is good programming
Good functional programming is good programming
 
Lisp
LispLisp
Lisp
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
 
Strong typing : adoption, adaptation and organisation
Strong typing : adoption, adaptation and organisationStrong typing : adoption, adaptation and organisation
Strong typing : adoption, adaptation and organisation
 
Introduction to Programming in LISP
Introduction to Programming in LISPIntroduction to Programming in LISP
Introduction to Programming in LISP
 
Lisp
LispLisp
Lisp
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)
 
2 Years of Real World FP at REA
2 Years of Real World FP at REA2 Years of Real World FP at REA
2 Years of Real World FP at REA
 
Crystal: tipos, peculiaridades y desafios
Crystal: tipos, peculiaridades y desafiosCrystal: tipos, peculiaridades y desafios
Crystal: tipos, peculiaridades y desafios
 
Programming for Problem Solving Unit 1
Programming for Problem Solving Unit 1Programming for Problem Solving Unit 1
Programming for Problem Solving Unit 1
 
Graph Data -- RDF and Property Graphs
Graph Data -- RDF and Property GraphsGraph Data -- RDF and Property Graphs
Graph Data -- RDF and Property Graphs
 
Strong typing @ php leeds
Strong typing  @ php leedsStrong typing  @ php leeds
Strong typing @ php leeds
 
Lisp and scheme i
Lisp and scheme iLisp and scheme i
Lisp and scheme i
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
 
Introduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogicIntroduction to Type Script by Sam Goldman, SmartLogic
Introduction to Type Script by Sam Goldman, SmartLogic
 
Functions, List and String methods
Functions, List and String methodsFunctions, List and String methods
Functions, List and String methods
 
Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Property-based testing of XMPP: generate your tests automatically - ejabberd ...Property-based testing of XMPP: generate your tests automatically - ejabberd ...
Property-based testing of XMPP: generate your tests automatically - ejabberd ...
 
Swift Reversing by Ryan Stortz
Swift Reversing by Ryan StortzSwift Reversing by Ryan Stortz
Swift Reversing by Ryan Stortz
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 
Dr archana dhawan bajaj - c# dot net
Dr archana dhawan bajaj - c# dot netDr archana dhawan bajaj - c# dot net
Dr archana dhawan bajaj - c# dot net
 

Similar to Let’s have some fun with Power Query M language

Demystifying Shapeless
Demystifying Shapeless Demystifying Shapeless
Demystifying Shapeless
Jared Roesch
 
The Fuss about || Haskell | Scala | F# ||
The Fuss about || Haskell | Scala | F# ||The Fuss about || Haskell | Scala | F# ||
The Fuss about || Haskell | Scala | F# ||
Ashwin Rao
 
Дмитрий Нестерук, Паттерны проектирования в XXI веке
Дмитрий Нестерук, Паттерны проектирования в XXI векеДмитрий Нестерук, Паттерны проектирования в XXI веке
Дмитрий Нестерук, Паттерны проектирования в XXI веке
Sergey Platonov
 
Design Patterns in Modern C++
Design Patterns in Modern C++Design Patterns in Modern C++
Design Patterns in Modern C++
Dmitri Nesteruk
 
Return of c++
Return of c++Return of c++
Return of c++
Yongwei Wu
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years Ago
Scott Wlaschin
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTW
Adriano Bonat
 
Denis Lebedev, Swift
Denis  Lebedev, SwiftDenis  Lebedev, Swift
Denis Lebedev, Swift
Yandex
 
Introduction to Python for Plone developers
Introduction to Python for Plone developersIntroduction to Python for Plone developers
Introduction to Python for Plone developers
Jim Roepcke
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
Amir Barylko
 
What the C?
What the C?What the C?
What the C?
baccigalupi
 
Modern C++
Modern C++Modern C++
Modern C++
Michael Clark
 
Scheme language
Scheme languageScheme language
Scheme language
JITENDRA LENKA
 
Test First Teaching
Test First TeachingTest First Teaching
Test First Teaching
Sarah Allen
 
Trends in programming languages
Trends in programming languagesTrends in programming languages
Trends in programming languages
Antya Dev
 
The internals of Spark SQL Joins, Dmytro Popovich
The internals of Spark SQL Joins, Dmytro PopovichThe internals of Spark SQL Joins, Dmytro Popovich
The internals of Spark SQL Joins, Dmytro Popovich
Sigma Software
 
Python: an introduction for PHP webdevelopers
Python: an introduction for PHP webdevelopersPython: an introduction for PHP webdevelopers
Python: an introduction for PHP webdevelopers
Glenn De Backer
 
Ayudando a los Viajeros usando 500 millones de Reseñas Hoteleras al Mes
Ayudando a los Viajeros usando 500 millones de Reseñas Hoteleras al MesAyudando a los Viajeros usando 500 millones de Reseñas Hoteleras al Mes
Ayudando a los Viajeros usando 500 millones de Reseñas Hoteleras al Mes
Big Data Colombia
 
Crystal presentation in NY
Crystal presentation in NYCrystal presentation in NY
Crystal presentation in NY
Crystal Language
 
Intro to kotlin 2018
Intro to kotlin 2018Intro to kotlin 2018
Intro to kotlin 2018
Shady Selim
 

Similar to Let’s have some fun with Power Query M language (20)

Demystifying Shapeless
Demystifying Shapeless Demystifying Shapeless
Demystifying Shapeless
 
The Fuss about || Haskell | Scala | F# ||
The Fuss about || Haskell | Scala | F# ||The Fuss about || Haskell | Scala | F# ||
The Fuss about || Haskell | Scala | F# ||
 
Дмитрий Нестерук, Паттерны проектирования в XXI веке
Дмитрий Нестерук, Паттерны проектирования в XXI векеДмитрий Нестерук, Паттерны проектирования в XXI веке
Дмитрий Нестерук, Паттерны проектирования в XXI веке
 
Design Patterns in Modern C++
Design Patterns in Modern C++Design Patterns in Modern C++
Design Patterns in Modern C++
 
Return of c++
Return of c++Return of c++
Return of c++
 
Four Languages From Forty Years Ago
Four Languages From Forty Years AgoFour Languages From Forty Years Ago
Four Languages From Forty Years Ago
 
Functional Programming #FTW
Functional Programming #FTWFunctional Programming #FTW
Functional Programming #FTW
 
Denis Lebedev, Swift
Denis  Lebedev, SwiftDenis  Lebedev, Swift
Denis Lebedev, Swift
 
Introduction to Python for Plone developers
Introduction to Python for Plone developersIntroduction to Python for Plone developers
Introduction to Python for Plone developers
 
Who killed object oriented design?
Who killed object oriented design?Who killed object oriented design?
Who killed object oriented design?
 
What the C?
What the C?What the C?
What the C?
 
Modern C++
Modern C++Modern C++
Modern C++
 
Scheme language
Scheme languageScheme language
Scheme language
 
Test First Teaching
Test First TeachingTest First Teaching
Test First Teaching
 
Trends in programming languages
Trends in programming languagesTrends in programming languages
Trends in programming languages
 
The internals of Spark SQL Joins, Dmytro Popovich
The internals of Spark SQL Joins, Dmytro PopovichThe internals of Spark SQL Joins, Dmytro Popovich
The internals of Spark SQL Joins, Dmytro Popovich
 
Python: an introduction for PHP webdevelopers
Python: an introduction for PHP webdevelopersPython: an introduction for PHP webdevelopers
Python: an introduction for PHP webdevelopers
 
Ayudando a los Viajeros usando 500 millones de Reseñas Hoteleras al Mes
Ayudando a los Viajeros usando 500 millones de Reseñas Hoteleras al MesAyudando a los Viajeros usando 500 millones de Reseñas Hoteleras al Mes
Ayudando a los Viajeros usando 500 millones de Reseñas Hoteleras al Mes
 
Crystal presentation in NY
Crystal presentation in NYCrystal presentation in NY
Crystal presentation in NY
 
Intro to kotlin 2018
Intro to kotlin 2018Intro to kotlin 2018
Intro to kotlin 2018
 

Recently uploaded

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 

Recently uploaded (20)

HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 

Let’s have some fun with Power Query M language

  • 1. It’s Power Query M Let’s have some fun! Cédric L. Charlier @Seddryck
  • 2. Sponsors help us to run this event! THX! You Rock! Sponsor Gold Sponsor Silver Sponsor Bronze Sponsor
  • 3. You Rock! Sponsor Session 13:45 Track 1 „Das super nerdige Solisyon Film- und Serienquiz“
  • 4. 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
  • 5. In a nutshell Open-sources contributions Skills & Interests Recognitions  Agile data warehouse  Quality-oriented  Automation fanboy  Microsoft MVP Data Platform award  Agile leader of the month  Database architecture  Data modeling  Business intelligence  Data warehousing  ETL  Olap/Tabular  No SQL  Big data  Data analysis  Machine learning  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 Experience  15 years with SQL Server  Former consultant, working internally for Elia Cédric L. Charlier @Seddryck seddryck.wordpress.com Data & BI architect
  • 6. 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
  • 7. 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
  • 8. 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
  • 9. Expressiveness of a functional language C# (imperative 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; } } Elixir (functional way) defmodule Fibonacci do def fib(0), do: 0 def fib(1), do: 1 def fib(n), do: fib(n-1) + fib(n-2) end
  • 10. 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 [ A = 1, B = 2, C = 3 ] // a record #table( {"A", "B"}, { {1, 2}, {3, 4} } )
  • 11. 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
  • 12. Function and evaluation • Parameters between brackets • Symbol => to separate declaration and implementation • Lazy evaluation of function • Persistence of evaluation (x, y) => (x + y) / 2 [ A1 = A2 * 2, A2 = A3 + 1, A3 = 1 ] Equivalent to [ A1 = 4, A2 = 2, A3 = 1 ]
  • 13. 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(…)
  • 14. 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)
  • 15. Power Query editor • “Advanced editor” • Notepad++ • Visual Studio and Power Query SDK
  • 16. The secret of being boring is to say everything Voltaire
  • 17. 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
  • 18. 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 !!!
  • 19. 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 …
  • 20. Demo: parse some html characters • Encoded with pattern &#number; • First iteration: • Only 1 special char by word • No error • Expl: C&#233;dric is translated to Cédric
  • 21. 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!
  • 22. 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]
  • 23. 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)
  • 24. 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 !!!
  • 25. Recursive function Scoping operator “@” (arrobas) [ Factorial = (x) => if x = 0 then 1 else x * @Factorial(x - 1), Result = Factorial(3) // 6 ]
  • 26. Demo: back to the html characters • Encoded with pattern &#number; • Second iteration: • None or many special chars in a word • Expl: H&#233;l&#232;ne is translated to Hélène Alice is translated to Alice Cl&#233;mence is translated to Clémence
  • 27. 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 !!!
  • 28. 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
  • 29. Demo Manage customers: • Update “Age” • Insert new customers
  • 30. 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 !!!
  • 31. Metadata Information associated to a value Presented as a record • Assign "Mozart" meta [ Rating = 5, Tags = {"Classical"} ] • Retrieve Value.Metadata( "Mozart" )
  • 32. Demo • Retrieve content of a website • Handling not existing/available website
  • 33. 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
  • 34. Sponsors You Rock! Sponsor Gold Sponsor Silver Sponsor Bronze Sponsor