Template:NZ population data/doc
This is a documentation subpage for Template:NZ population data. It may contain usage information, categories and other content that is not part of the original template page. |
Usage
changeThis template is to supply uniform, up-to-date population data to New Zealand articles. It facilitates a mass update of all the population numbers in articles.
It is used for dynamically-changing populations. Populations on a specific date should not use this template, but should instead be hard-coded manually into the article.
Adding to an article
change{{NZ population data|Example city|y|y|y}}
The template has seven parameters:
- area = Statistics NZ name of area for population (e.g. Lower Hutt City). This parameter is mandatory if showpopulation is used. List of names here
- showpopulation = display the population figure
- showtitle = display the title (e.g. "June 2008")
- showref = display the reference, can subsequently be reused by adding: <ref name="NZ_population_data"/>
- titlepre = free text before the title, for example to add parentheses
- titlepost = free text after the title
Leaving a show parameter empty results in that value being hidden.
The template data uses formatted text numbers, with the comma thousands separator, which is suitable for the majority of uses. For the numerical value, for example to use in {{Infobox Settlement}}, use the formula: {{formatnum:{{NZ population data| ##Example city## |y}}|R}}
Automatically updating formulae
change- Population density: {{Decimals|{{formatnum:{{NZ population data| ##Example city## |y}}|R}}/ ##numerical land area## |1}}
- Percent of national population: {{Decimals|{{formatnum:{{NZ population data| ##Example city## |y}}|R}}/{{formatnum:{{NZ population data|New Zealand|y}}|R}}*100|1}}
Annual update
changeThe data on this template needs to be updated once per year, as of 2016 Statistics NZ releases annual population estimates around 20 October.
- Download latest spreadsheet from Statistics New Zealand
- In a new spreadsheet, collect the data from all tables to get two columns, area name and most recent year data
- create a new column with formula =" | "&A1&" = "&B1 for first entry, copy down entire column. May need an adjustment to keep commas in the numbers
- copy & paste results into template
- update the name "June XXXX"
- update the reference
- verify Statistics NZ names are consistent with "Show changes", affected articles need the new name
- verify everything is ok by looking at a sample of pages. You may need to purge the cache on some articles by adding ?action=purge to the end of the URL for changes to show.
- List of cities in New Zealand and List of New Zealand urban areas need checks for rank changes, affected articles may need a minor reword