statisticssweden / PxWeb

Web application for disseminating statistical tables
https://www.scb.se/pxweb
Apache License 2.0
30 stars 23 forks source link

Is PRECISION really language dependent? #623

Closed johan-ejstrud closed 4 months ago

johan-ejstrud commented 4 months ago

Question

In the Px-file specification it says that the keyword PRECISION is language dependent. Is that really the case?

I tried creating a small example where I have different PRECISION for the two languages in the file. However, switching languages doesn't seem to change the number of decimals in neither PxEdit or PxWeb.

Example

File: precision_test.txt image image image

Background

I'm asking because I'm working on a package to create px files in R. I had originally implemented PRECISION as language independent, but then stumbeled upon this in the specification.

JohannesFinsveen commented 4 months ago

Hi, cool that you are working on pxmake!

I dont think there is a use case for having different numbers for each language :-) , so PxWeb seems to use the last value.

With this input to pxweb, PRECISION [sv]("gendersv","F")=2; PRECISION("gender","F")=3; I get this when I as to px-file PRECISION[sv]("gendersv","F")=3; which I think is good.

The keypart needs language because of the text. So its not fair to say language independent either :-)

Finland has this nice page: https://github.com/PxTools/Px.Utils/blob/dev/docs/PXFILE_SPECIFICATION.md

johan-ejstrud commented 4 months ago

Thank you @JohannesFinsveen

Good point about the language being needed for the text. 👍 I now know how I need to implement it.

And thanks for the link. I have been lurking on PxTools, but not spotted that document. I'll have a look. :)