-
Notifications
You must be signed in to change notification settings - Fork 19
/
get-ExchangeRatesOfCZK.pq
37 lines (37 loc) · 1.44 KB
/
get-ExchangeRatesOfCZK.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
let
fct =
(startYear as number, endYear as number) =>
let
csvExtaction =
(fl as binary) =>
Csv.Document(
fl,
[
Delimiter = "|",
Encoding = 65001,
QuoteStyle = QuoteStyle.None
]
),
transformator =
List.Transform(
{startYear..endYear},
each
let
caller =
Web.Contents(
"https://www.cnb.cz",
[
RelativePath = "cs/financni-trhy/devizovy-trh/kurzy-devizoveho-trhu/kurzy-devizoveho-trhu/rok.txt",
Query = [
rok = Text.From(_)
]
]
),
extract = Table.PromoteHeaders(csvExtaction(caller))
in
extract
)
in
Table.Combine(transformator)
in
fct