WikiNewZealand / fundamental-figures

0 stars 0 forks source link

Grouping variable separator needs amendment #2

Closed natdudley closed 5 years ago

natdudley commented 5 years ago

Grouping variables don't always work with by.

Can we please either:

e.g.

Number of businesses by Birth should be "Number of businesses - created"

but, Total Main Benefits is better as "Total Main Benefits by age" rather than "- age"

Spksh commented 5 years ago

Is there a default you'd want to use if you didn't specify a separator?

natdudley commented 5 years ago

I think '-' is the safest default

natdudley commented 5 years ago

Where - is actually an em dash.

Spksh commented 5 years ago

Have changed group syntax to add separator, include, and exclude. Existing json files will need to be modified.

New syntax looks like this:

        "group": {
          "column": "xxxx",
          "separator": "----",
          "include": [
            {
              "value": "aaaa"
            },
            {
              "value": "bbbb"
            },
            {
              "value": "cccc"
            },
            {
              "value": "dddd",
              "label": "d" 
            }
          ],
          "exclude": [
            "yyyy",
            "zzzz"
          ]
        }

e.g.:

    {
      "uri": "https://figure.nz/table/a5X7TSwPRjKASUSv/download",
      "parent": "Income",
      "measure": {
        "column": "Benefit type",
        "group": {
          "column": "Grouping variable",
          "separator": "by",
          "include": [
            {
              "value": "Gender"
            },
            {
              "value": "Ethnic Group"
            },
            {
              "value": "Age Group"
            },
            {
              "value": "Continuous Duration",
              "label": "Duration" 
            }
          ],
          "exclude": []
        },
        "include": [],
        "exclude": []
      },
      "category": {
        "column": "Category",
        "include": [],
        "exclude": []
      },
      "date": "Quarter"
    }