SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Microsoft MVP - Data Platform / かがたたけし
PowerBIxyz
takeshi.kagata @powerbixyz
Road to Power Query NINJA – 1st STEP
Don’t think, Feel.
Power Query 秘密特訓「虎の穴」
2018-11-10
#PowerBI #PBIJPどのようなことが起きているのか?
let
Source = {1 .. Number.Power( 2, 31 ) - 1},
#"Filtered?" = List.Transform(
Source,
each Number.Power( _, _ )
),
Filter = List.FirstN( #"Filtered?", 10 )
// Filter = List.FirstN( #"Filtered?", each _ <= 10000000000 )
// Filter = List.Select( #"Filtered?", each _ <= 10000000000 )
in
Filter
#PowerBI #PBIJP不要な評価はしない
List.FirstN(
List.Transform(
{1 .. Number.Power( 2, 31 ) - 1},
each Number.Power( _, _ )
),
10 // 先頭 10 アイテム で完了ということが早いうちにわかっている
)
見えるようにする
#PowerBI #PBIJP数式バーは必ず表示
1000
#PowerBI #PBIJPそもそも プレビュー データ なので
#PowerBI #PBIJP現れないこともある
50%
#PowerBI #PBIJP条件は反転する
type
#PowerBI #PBIJP見えるものはすべて知るべし
#shared
{ }
[ ]
#PowerBI #PBIJPリスト – { }
値(value) と その順番を表す
{ value1, … , valuen }
{ 1, 2, 3 } = { 1, 2, 3 } // true
{ 1, 2, 3 } = { 1, 3 } // false
{ 1, 2, 3 } <> { 1, 3 } // true
{ 1, 2, 3 } = { 1, 3, 2 } // false
{ 1, 2, 3 } = { 1, “2”, 3 } // false
{ 1, 2, { 10, 20 } } = { 1, 2, { 10, 20 } } // true
{ 1, 2, { 10, 20 } } = { 1, 2, { 10, 20, 30 } } // false
#PowerBI #PBIJPリスト と 演算子など
{ 1 .. 3 } = { 1, 2, 3}
{ 3 .. 1 } = { }
{ “B” .. “D” } = { “B”, “C”, “D” }
{ 7, 2 .. 4, 1 } = { 7, 2, 3, 4, 1}
{ 1, 2, 3 } & { 4, 5 } = { 1 .. 5 }
List.Combine( { { 1, 2, 3 }, { 4, 5 }, { 0 } } ) = { 1 .. 5, 0 }
#PowerBI #PBIJPItem access – { }
{ } と { }
{ 10, 20, 30 }{ 0 } = 10 // true
{ 10, 20, 30 }{ -1 } // Expression.Error
{ 10, 20, 30 }{ 3 } // Expression.Error
{ 10, 20, 30 }{ 3 }? = null // true
let
idx = 1,
item = { 10, 20, 30 }{ idx }
in
item // 20
#PowerBI #PBIJPレコード – [ ]
定義されたフィールド(field) と その値(value)の組み合わせ
[ fieldname1 = value1, …, fieldnamen = valuen ]
[Field1=10, Field2=20] = [Field1=10, Field2=20] // true
[Field1=10, Field2=20] = [Field2=20, Field1=10] // true
[Field1=10, Field2=20] = [Field1=10, Field2=30] // false
[Field1=10, Field2=20] = [Field1=10, Field2=20, Field3=30] // false
[Field1=10, Field2=20] <> [Field1=10] // true
遅延評価
[Field1=10, Field2=Field1 + 10, Field3=Field1+Field2 ]
= [Field1=10, Field2=20, Field3=30] // true
#PowerBI #PBIJPField access と 演算子など
[ ] と [ ]
[Field1=10, Field2=20][Field1] = 10 // true
[Field1=10, Field2=20][Field3] // Expression.Error
[Field1=10, Field2=20][Field3]? = null // true
[Field1=10, Field2=20, Field3=30][[Field1], [Field2]]
= [Field1=10, Field2=20]
[Field1=10, Field2=20] & [Field3=30] = [Field1=10, Field2=20, Field3=30]
[Field1=10, Field2=20] & [Field2=30] = [Field1=10, Field2=30]
#PowerBI #PBIJPField access – 関数
let
FieldName = { "Field1", "Field3" },
Record = [ Field1 = 10, Field2 = 20 ],
FieldValues =
{
Record.Field( Record, FieldName{ 0 } ),
Record.FieldOrDefault( Record, FieldName{ 1 } ),
Record.FieldOrDefault( Record, FieldName{ 1 }, 0 )
}
in
FieldValues // { 10, null, 0 }
#table
#PowerBI #PBIJP#table
#table(
{ “column_name1”, …, “column_namen” },
{
{ value1, … , valuen }, …
}
)
#table(
type table [ column_name1 = type1, …, “column_namen” = typen ],
{
{ value1, …, valuen}, …
}
)
#PowerBI #PBIJP#table 以外
当然違いがある
Table.FromColumns(lists as list, optional columns as any) as table
Table.FromList(list as list, optional splitter as nullable function,
optional columns as any, optional default as any, optional extraValues as
nullable ExtraValues.Type) as table
Table.FromRecords(records as list, optional columns as any, optional
missingField as nullable MissingField.Type) as table
Table.FromRows(rows as list, optional columns as any) as table
Table.FromValue(value as any, options as nullable record) as table
Record.ToTable(record as record) as table
テーブル と { } [ ]
#PowerBI #PBIJPレコードとリストとテーブル
table{n}
table{[column_Name = value]}
table[column_Name]
table[[column_Name1], [column_Namen]] // type table
Operator Type
table
Row { } : Item access record
Column [ ] : Field access list
function
#PowerBI #PBIJPUDF
引数なし
() => 0
引数あり
( x, y ) => x + y
( x ) => ( y ) => (x + y)
オプション引数
( value1, optional value2 ) => [ Field1 = value1, Field2 = value2 ]
データ型
( x as text, y as number ) as text => Text.Repeat( x, y )
#PowerBI #PBIJPUDF
クエリの中で定義する
Let
fn = ( x ) => x + 10,
prm = 10,
Result = fn( prm )
in
Result
レコードで定義もできる
let
fn =
(x) => [result = x + 10][result],
prm = 10,
Result =fn( prm )
in
Result
each _
#PowerBI #PBIJPeach _ は function
ex. List.Transfrom( list as list, transform as function )
List.Transfrom( list, each _ + 1 )
⇩
List.Transfrom( list, (_) => _ + 1 )
⇩
List.Transfrom( list, (currentItem) => currentItem + 1 )
⇩
List.Transfrom(
list,
(currentItem) => let return = currentItem + 1 in return
)

Weitere ähnliche Inhalte

Was ist angesagt?

Unit 4 python -list methods
Unit 4   python -list methodsUnit 4   python -list methods
Unit 4 python -list methodsnarmadhakin
 
Why async and functional programming in PHP7 suck and how to get overr it?
Why async and functional programming in PHP7 suck and how to get overr it?Why async and functional programming in PHP7 suck and how to get overr it?
Why async and functional programming in PHP7 suck and how to get overr it?Lucas Witold Adamus
 
Python programming -Tuple and Set Data type
Python programming -Tuple and Set Data typePython programming -Tuple and Set Data type
Python programming -Tuple and Set Data typeMegha V
 
Class 2: Welcome part 2
Class 2: Welcome part 2Class 2: Welcome part 2
Class 2: Welcome part 2Marc Gouw
 
Class 5: If, while & lists
Class 5: If, while & listsClass 5: If, while & lists
Class 5: If, while & listsMarc Gouw
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in pythoneShikshak
 
Python Workshop Part 2. LUG Maniapl
Python Workshop Part 2. LUG ManiaplPython Workshop Part 2. LUG Maniapl
Python Workshop Part 2. LUG ManiaplAnkur Shrivastava
 
Basic data structures in python
Basic data structures in pythonBasic data structures in python
Basic data structures in pythonCeline George
 
Class 7a: Functions
Class 7a: FunctionsClass 7a: Functions
Class 7a: FunctionsMarc Gouw
 
Menu func-sh(1)
Menu func-sh(1)Menu func-sh(1)
Menu func-sh(1)Ben Pope
 
Data structure in perl
Data structure in perlData structure in perl
Data structure in perlsana mateen
 

Was ist angesagt? (19)

Unit 4 python -list methods
Unit 4   python -list methodsUnit 4   python -list methods
Unit 4 python -list methods
 
Why async and functional programming in PHP7 suck and how to get overr it?
Why async and functional programming in PHP7 suck and how to get overr it?Why async and functional programming in PHP7 suck and how to get overr it?
Why async and functional programming in PHP7 suck and how to get overr it?
 
Python Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - ListsPython Programming Essentials - M12 - Lists
Python Programming Essentials - M12 - Lists
 
Array operators
Array operatorsArray operators
Array operators
 
Python programming : List and tuples
Python programming : List and tuplesPython programming : List and tuples
Python programming : List and tuples
 
Python programming -Tuple and Set Data type
Python programming -Tuple and Set Data typePython programming -Tuple and Set Data type
Python programming -Tuple and Set Data type
 
Class 2: Welcome part 2
Class 2: Welcome part 2Class 2: Welcome part 2
Class 2: Welcome part 2
 
Class 5: If, while & lists
Class 5: If, while & listsClass 5: If, while & lists
Class 5: If, while & lists
 
Python list
Python listPython list
Python list
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
 
List in Python
List in PythonList in Python
List in Python
 
Python Workshop Part 2. LUG Maniapl
Python Workshop Part 2. LUG ManiaplPython Workshop Part 2. LUG Maniapl
Python Workshop Part 2. LUG Maniapl
 
Basic data structures in python
Basic data structures in pythonBasic data structures in python
Basic data structures in python
 
Class 7a: Functions
Class 7a: FunctionsClass 7a: Functions
Class 7a: Functions
 
Menu func-sh(1)
Menu func-sh(1)Menu func-sh(1)
Menu func-sh(1)
 
1 pythonbasic
1 pythonbasic1 pythonbasic
1 pythonbasic
 
cgipmtut
cgipmtutcgipmtut
cgipmtut
 
PHP 101
PHP 101 PHP 101
PHP 101
 
Data structure in perl
Data structure in perlData structure in perl
Data structure in perl
 

Ähnlich wie Road to Power Query NINJA – 1st STEP

A "M"ind Bending Experience. Power Query for Power BI and Beyond.
A "M"ind Bending Experience. Power Query for Power BI and Beyond.A "M"ind Bending Experience. Power Query for Power BI and Beyond.
A "M"ind Bending Experience. Power Query for Power BI and Beyond.Alex Powers
 
A "M"ind Bending Experience. Power Query for Power BI and Beyond.
A "M"ind Bending Experience. Power Query for Power BI and Beyond.A "M"ind Bending Experience. Power Query for Power BI and Beyond.
A "M"ind Bending Experience. Power Query for Power BI and Beyond.Alex Powers
 
Kotlin collections
Kotlin collectionsKotlin collections
Kotlin collectionsMyeongin Woo
 
Morel, a Functional Query Language
Morel, a Functional Query LanguageMorel, a Functional Query Language
Morel, a Functional Query LanguageJulian Hyde
 
Functional techniques in Ruby
Functional techniques in RubyFunctional techniques in Ruby
Functional techniques in Rubyerockendude
 
Functional techniques in Ruby
Functional techniques in RubyFunctional techniques in Ruby
Functional techniques in Rubyerockendude
 
An introduction to functional programming with Swift
An introduction to functional programming with SwiftAn introduction to functional programming with Swift
An introduction to functional programming with SwiftFatih Nayebi, Ph.D.
 
The underestimated power of KeyPaths
The underestimated power of KeyPathsThe underestimated power of KeyPaths
The underestimated power of KeyPathsVincent Pradeilles
 
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...PROIDEA
 
Arrow 101 - Kotlin funcional com Arrow
Arrow 101 - Kotlin funcional com ArrowArrow 101 - Kotlin funcional com Arrow
Arrow 101 - Kotlin funcional com ArrowLeandro Ferreira
 
Power of functions in a typed world
Power of functions in a typed worldPower of functions in a typed world
Power of functions in a typed worldDebasish Ghosh
 
Postgresql 9.3 overview
Postgresql 9.3 overviewPostgresql 9.3 overview
Postgresql 9.3 overviewAveic
 
02 Arrays And Memory Mapping
02 Arrays And Memory Mapping02 Arrays And Memory Mapping
02 Arrays And Memory MappingQundeel
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meetMario Fusco
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshopBAINIDA
 
Implement the ListArray ADT-Implement the following operations.pdf
Implement the ListArray ADT-Implement the following operations.pdfImplement the ListArray ADT-Implement the following operations.pdf
Implement the ListArray ADT-Implement the following operations.pdfpetercoiffeur18
 
The Arrow Library in Kotlin
The Arrow Library in KotlinThe Arrow Library in Kotlin
The Arrow Library in KotlinGarth Gilmour
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersTikal Knowledge
 

Ähnlich wie Road to Power Query NINJA – 1st STEP (20)

A "M"ind Bending Experience. Power Query for Power BI and Beyond.
A "M"ind Bending Experience. Power Query for Power BI and Beyond.A "M"ind Bending Experience. Power Query for Power BI and Beyond.
A "M"ind Bending Experience. Power Query for Power BI and Beyond.
 
A "M"ind Bending Experience. Power Query for Power BI and Beyond.
A "M"ind Bending Experience. Power Query for Power BI and Beyond.A "M"ind Bending Experience. Power Query for Power BI and Beyond.
A "M"ind Bending Experience. Power Query for Power BI and Beyond.
 
Begin with Python
Begin with PythonBegin with Python
Begin with Python
 
Kotlin collections
Kotlin collectionsKotlin collections
Kotlin collections
 
Morel, a Functional Query Language
Morel, a Functional Query LanguageMorel, a Functional Query Language
Morel, a Functional Query Language
 
Functional techniques in Ruby
Functional techniques in RubyFunctional techniques in Ruby
Functional techniques in Ruby
 
Functional techniques in Ruby
Functional techniques in RubyFunctional techniques in Ruby
Functional techniques in Ruby
 
An introduction to functional programming with Swift
An introduction to functional programming with SwiftAn introduction to functional programming with Swift
An introduction to functional programming with Swift
 
The underestimated power of KeyPaths
The underestimated power of KeyPathsThe underestimated power of KeyPaths
The underestimated power of KeyPaths
 
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
 
Arrow 101 - Kotlin funcional com Arrow
Arrow 101 - Kotlin funcional com ArrowArrow 101 - Kotlin funcional com Arrow
Arrow 101 - Kotlin funcional com Arrow
 
Power of functions in a typed world
Power of functions in a typed worldPower of functions in a typed world
Power of functions in a typed world
 
Postgresql 9.3 overview
Postgresql 9.3 overviewPostgresql 9.3 overview
Postgresql 9.3 overview
 
02 Arrays And Memory Mapping
02 Arrays And Memory Mapping02 Arrays And Memory Mapping
02 Arrays And Memory Mapping
 
Scala - where objects and functions meet
Scala - where objects and functions meetScala - where objects and functions meet
Scala - where objects and functions meet
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
 
Implement the ListArray ADT-Implement the following operations.pdf
Implement the ListArray ADT-Implement the following operations.pdfImplement the ListArray ADT-Implement the following operations.pdf
Implement the ListArray ADT-Implement the following operations.pdf
 
The Arrow Library in Kotlin
The Arrow Library in KotlinThe Arrow Library in Kotlin
The Arrow Library in Kotlin
 
Ssrs expressions
Ssrs expressionsSsrs expressions
Ssrs expressions
 
JBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java ProgrammersJBUG 11 - Scala For Java Programmers
JBUG 11 - Scala For Java Programmers
 

Mehr von Takeshi Kagata

Power BI とは - 2020
Power BI とは - 2020Power BI とは - 2020
Power BI とは - 2020Takeshi Kagata
 
Power BI 概要と最近のこと / Power BI と AI
Power BI 概要と最近のこと / Power BI と AI Power BI 概要と最近のこと / Power BI と AI
Power BI 概要と最近のこと / Power BI と AI Takeshi Kagata
 
Power BI 概要と最近のこと 2018/12
Power BI 概要と最近のこと 2018/12Power BI 概要と最近のこと 2018/12
Power BI 概要と最近のこと 2018/12Takeshi Kagata
 
Power BI データフロー 早わかり
Power BI データフロー 早わかりPower BI データフロー 早わかり
Power BI データフロー 早わかりTakeshi Kagata
 
Power BI 勉強会 #9 Power BI 概要と最近のこと
Power BI 勉強会 #9 Power BI 概要と最近のことPower BI 勉強会 #9 Power BI 概要と最近のこと
Power BI 勉強会 #9 Power BI 概要と最近のことTakeshi Kagata
 
Power BI はじめの一歩 2018
Power BI はじめの一歩 2018Power BI はじめの一歩 2018
Power BI はじめの一歩 2018Takeshi Kagata
 
Power BI セミナー @ 名古屋 #2
Power BI セミナー @ 名古屋 #2Power BI セミナー @ 名古屋 #2
Power BI セミナー @ 名古屋 #2Takeshi Kagata
 
Power BI セミナー @ 名古屋
Power BI セミナー @ 名古屋Power BI セミナー @ 名古屋
Power BI セミナー @ 名古屋Takeshi Kagata
 
Power BI - 概要と 新しい機能など
Power BI - 概要と 新しい機能などPower BI - 概要と 新しい機能など
Power BI - 概要と 新しい機能などTakeshi Kagata
 
Excel 2016 データの取得と変換
Excel 2016 データの取得と変換Excel 2016 データの取得と変換
Excel 2016 データの取得と変換Takeshi Kagata
 

Mehr von Takeshi Kagata (11)

Power BI とは - 2020
Power BI とは - 2020Power BI とは - 2020
Power BI とは - 2020
 
Power BI 概要と最近のこと / Power BI と AI
Power BI 概要と最近のこと / Power BI と AI Power BI 概要と最近のこと / Power BI と AI
Power BI 概要と最近のこと / Power BI と AI
 
Power BI 概要と最近のこと 2018/12
Power BI 概要と最近のこと 2018/12Power BI 概要と最近のこと 2018/12
Power BI 概要と最近のこと 2018/12
 
Power BI データフロー 早わかり
Power BI データフロー 早わかりPower BI データフロー 早わかり
Power BI データフロー 早わかり
 
Power BI 勉強会 #9 Power BI 概要と最近のこと
Power BI 勉強会 #9 Power BI 概要と最近のことPower BI 勉強会 #9 Power BI 概要と最近のこと
Power BI 勉強会 #9 Power BI 概要と最近のこと
 
Power BI はじめの一歩 2018
Power BI はじめの一歩 2018Power BI はじめの一歩 2018
Power BI はじめの一歩 2018
 
Power BI セミナー @ 名古屋 #2
Power BI セミナー @ 名古屋 #2Power BI セミナー @ 名古屋 #2
Power BI セミナー @ 名古屋 #2
 
Power BI 勉強会 #6
Power BI 勉強会 #6Power BI 勉強会 #6
Power BI 勉強会 #6
 
Power BI セミナー @ 名古屋
Power BI セミナー @ 名古屋Power BI セミナー @ 名古屋
Power BI セミナー @ 名古屋
 
Power BI - 概要と 新しい機能など
Power BI - 概要と 新しい機能などPower BI - 概要と 新しい機能など
Power BI - 概要と 新しい機能など
 
Excel 2016 データの取得と変換
Excel 2016 データの取得と変換Excel 2016 データの取得と変換
Excel 2016 データの取得と変換
 

Kürzlich hochgeladen

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Kürzlich hochgeladen (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Road to Power Query NINJA – 1st STEP

  • 1. Microsoft MVP - Data Platform / かがたたけし PowerBIxyz takeshi.kagata @powerbixyz Road to Power Query NINJA – 1st STEP Don’t think, Feel. Power Query 秘密特訓「虎の穴」 2018-11-10
  • 2. #PowerBI #PBIJPどのようなことが起きているのか? let Source = {1 .. Number.Power( 2, 31 ) - 1}, #"Filtered?" = List.Transform( Source, each Number.Power( _, _ ) ), Filter = List.FirstN( #"Filtered?", 10 ) // Filter = List.FirstN( #"Filtered?", each _ <= 10000000000 ) // Filter = List.Select( #"Filtered?", each _ <= 10000000000 ) in Filter
  • 3. #PowerBI #PBIJP不要な評価はしない List.FirstN( List.Transform( {1 .. Number.Power( 2, 31 ) - 1}, each Number.Power( _, _ ) ), 10 // 先頭 10 アイテム で完了ということが早いうちにわかっている )
  • 9. 50%
  • 11. type
  • 15. #PowerBI #PBIJPリスト – { } 値(value) と その順番を表す { value1, … , valuen } { 1, 2, 3 } = { 1, 2, 3 } // true { 1, 2, 3 } = { 1, 3 } // false { 1, 2, 3 } <> { 1, 3 } // true { 1, 2, 3 } = { 1, 3, 2 } // false { 1, 2, 3 } = { 1, “2”, 3 } // false { 1, 2, { 10, 20 } } = { 1, 2, { 10, 20 } } // true { 1, 2, { 10, 20 } } = { 1, 2, { 10, 20, 30 } } // false
  • 16. #PowerBI #PBIJPリスト と 演算子など { 1 .. 3 } = { 1, 2, 3} { 3 .. 1 } = { } { “B” .. “D” } = { “B”, “C”, “D” } { 7, 2 .. 4, 1 } = { 7, 2, 3, 4, 1} { 1, 2, 3 } & { 4, 5 } = { 1 .. 5 } List.Combine( { { 1, 2, 3 }, { 4, 5 }, { 0 } } ) = { 1 .. 5, 0 }
  • 17. #PowerBI #PBIJPItem access – { } { } と { } { 10, 20, 30 }{ 0 } = 10 // true { 10, 20, 30 }{ -1 } // Expression.Error { 10, 20, 30 }{ 3 } // Expression.Error { 10, 20, 30 }{ 3 }? = null // true let idx = 1, item = { 10, 20, 30 }{ idx } in item // 20
  • 18. #PowerBI #PBIJPレコード – [ ] 定義されたフィールド(field) と その値(value)の組み合わせ [ fieldname1 = value1, …, fieldnamen = valuen ] [Field1=10, Field2=20] = [Field1=10, Field2=20] // true [Field1=10, Field2=20] = [Field2=20, Field1=10] // true [Field1=10, Field2=20] = [Field1=10, Field2=30] // false [Field1=10, Field2=20] = [Field1=10, Field2=20, Field3=30] // false [Field1=10, Field2=20] <> [Field1=10] // true 遅延評価 [Field1=10, Field2=Field1 + 10, Field3=Field1+Field2 ] = [Field1=10, Field2=20, Field3=30] // true
  • 19. #PowerBI #PBIJPField access と 演算子など [ ] と [ ] [Field1=10, Field2=20][Field1] = 10 // true [Field1=10, Field2=20][Field3] // Expression.Error [Field1=10, Field2=20][Field3]? = null // true [Field1=10, Field2=20, Field3=30][[Field1], [Field2]] = [Field1=10, Field2=20] [Field1=10, Field2=20] & [Field3=30] = [Field1=10, Field2=20, Field3=30] [Field1=10, Field2=20] & [Field2=30] = [Field1=10, Field2=30]
  • 20. #PowerBI #PBIJPField access – 関数 let FieldName = { "Field1", "Field3" }, Record = [ Field1 = 10, Field2 = 20 ], FieldValues = { Record.Field( Record, FieldName{ 0 } ), Record.FieldOrDefault( Record, FieldName{ 1 } ), Record.FieldOrDefault( Record, FieldName{ 1 }, 0 ) } in FieldValues // { 10, null, 0 }
  • 22. #PowerBI #PBIJP#table #table( { “column_name1”, …, “column_namen” }, { { value1, … , valuen }, … } ) #table( type table [ column_name1 = type1, …, “column_namen” = typen ], { { value1, …, valuen}, … } )
  • 23. #PowerBI #PBIJP#table 以外 当然違いがある Table.FromColumns(lists as list, optional columns as any) as table Table.FromList(list as list, optional splitter as nullable function, optional columns as any, optional default as any, optional extraValues as nullable ExtraValues.Type) as table Table.FromRecords(records as list, optional columns as any, optional missingField as nullable MissingField.Type) as table Table.FromRows(rows as list, optional columns as any) as table Table.FromValue(value as any, options as nullable record) as table Record.ToTable(record as record) as table
  • 25. #PowerBI #PBIJPレコードとリストとテーブル table{n} table{[column_Name = value]} table[column_Name] table[[column_Name1], [column_Namen]] // type table Operator Type table Row { } : Item access record Column [ ] : Field access list
  • 27. #PowerBI #PBIJPUDF 引数なし () => 0 引数あり ( x, y ) => x + y ( x ) => ( y ) => (x + y) オプション引数 ( value1, optional value2 ) => [ Field1 = value1, Field2 = value2 ] データ型 ( x as text, y as number ) as text => Text.Repeat( x, y )
  • 28. #PowerBI #PBIJPUDF クエリの中で定義する Let fn = ( x ) => x + 10, prm = 10, Result = fn( prm ) in Result レコードで定義もできる let fn = (x) => [result = x + 10][result], prm = 10, Result =fn( prm ) in Result
  • 30. #PowerBI #PBIJPeach _ は function ex. List.Transfrom( list as list, transform as function ) List.Transfrom( list, each _ + 1 ) ⇩ List.Transfrom( list, (_) => _ + 1 ) ⇩ List.Transfrom( list, (currentItem) => currentItem + 1 ) ⇩ List.Transfrom( list, (currentItem) => let return = currentItem + 1 in return )