-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathget-AllWorldCountriesWithDetails.pq
38 lines (38 loc) · 1.26 KB
/
get-AllWorldCountriesWithDetails.pq
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
let
output =
() =>
let
Source = Json.Document(Web.Contents("https://restcountries.eu/rest/v2/all")),
tbl =
Table.FromList(
Source,
Splitter.SplitByNothing(),
null,
null,
ExtraValues.Error
),
list_of_names = Record.FieldNames(tbl[Column1]{0}),
expand =
Table.ExpandRecordColumn(
tbl,
"Column1",
list_of_names,
list_of_names
)
in
expand,
documentation = [
Documentation.Name = " get-AllWorldCountriesWithDetails.pq ",
Documentation.Description = " Return list of Countries in the world with details as Catipal, Phone, Area, Languages, CurrencyCode etc. ",
Documentation.Source = "https://www.jaknapowerbi.cz . ",
Documentation.Version = " 1.0 ",
Documentation.Author = " Štěpán Rešl "
]
in
Value.ReplaceType(
output,
Value.ReplaceMetadata(
Value.Type(output),
documentation
)
)