You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ Available commands:
13
13
*[jsonstat2arrobj](#jsonstat2arrobj) - converts JSON-stat into an array of objects
14
14
*[jsonstat2csv](#jsonstat2csv) - converts JSON-stat into CSV
15
15
*[jsonstat2object](#jsonstat2object) - converts JSON-stat into an object
16
+
*[jsonstatslice](#jsonstatslice) - creates a subset from JSON-stat
16
17
17
18
## Example
18
19
@@ -351,3 +352,29 @@ Boolean. Identifies categories by ID instead of label.
351
352
```
352
353
jsonstat2object oecd.json oecd-object.json --cid
353
354
```
355
+
356
+
## jsonstatslice
357
+
358
+
Creates a JSON-stat subset from a JSON-stat dataset. A JSON-stat subset has the same dimensions as the original dataset but with some of them fixed for a certain category.
In the previous example, oecd-subset.json only contains data for Germany in 2014.
365
+
366
+
#### --filter (-f)
367
+
368
+
String. Specifies a filter. When no filter is specified, the original JSON-stat will be returned.
369
+
370
+
A filter is a comma-separated list of selection criteria. Each criterion must follow the pattern *{dimension id}={category id}*. Because dimension ids and category ids are strings that can contain whitespaces, they should be double-quoted.
371
+
372
+
```
373
+
"area"="DE","year"="2014"
374
+
```
375
+
376
+
forces the subset to keep only category "DE" from dimension "area" and category "2014" from dimension "year". Because these ids do not contain whitespaces, double quotes are not strictly necessary.
.example("$0 oecd.json oecd-subset.json -f \"area\"=\"DE\",\"year\"=\"2014\"","converts JSON-stat file oecd.json into a new JSON-stat file (oecd-subset.json).")
8
+
.example("$0 < oecd.json > oecd-subset.json -f \"area\"=\"DE\",\"year\"=\"2014\" -t","converts JSON-stat stream oecd.json into a new JSON-stat stream (oecd-subset.json).")
0 commit comments