-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathget-DataToJson.pq
27 lines (27 loc) · 956 Bytes
/
get-DataToJson.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
let
output =
(toTable as table) as text =>
let
#"Run R script" =
R.Execute(
"# 'dataset' holds the input data for this script#(lf)library(jsonlite)#(lf)df <- data.frame(toString(toJSON(dataset)))",
[dataset = toTable]
),
#"""df""" = #"Run R script"{[Name = "df"]}[Value]
in
#"""df"""{0}[#"toString.toJSON.dataset.."],
documentation = [
Documentation.Name = " get-DataToJson.pq ",
Documentation.Description = " Trasform full table into one JSON as Text ",
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
)
)