Newbie questions: what the dimension for a value?

31 views
Skip to first unread message

Duraid Abbas

unread,
Apr 2, 2019, 11:11:37 AM4/2/19
to json-stat
I'm having a problem understanding the `value` field because it a one dimensional array. how do i know which dimensions belong to which value? 

If I understand correctly the `value` field is a full cube i.e. it contains a value for each possible dimension combination and the user has to iterate through the dimension values in order to pair the dimensions with values. I'm I right?

Xavier Badosa

unread,
Apr 3, 2019, 7:47:20 AM4/3/19
to json...@googlegroups.com
Yes, you are correct. The flattening method is the row-major order:


As explained in the spec

values are ordered by combination of category dimensions keeping fixed the first categories of the first dimensions and iterating through the categories of the last dimension in the id array (and so forth).

For example, if we have three dimensions (A, B and C) with 3, 2 and 4 categories respectively, the values should be ordered iterating first by the 4 categories of C, then by the 2 categories of B and finally by the 3 categories of A


Maybe the slides (35-65) in this presentation 


can also be useful.

X.

Duraid

unread,
Apr 3, 2019, 10:06:50 AM4/3/19
to json...@googlegroups.com
Thank you Xavier. I think this can be a problem for sparse cubes as cube sizes can be in the millions or even billions (for all possible combinations) but only a small fraction of actual data. 

I saw in the documentation a solution for sparse cubes but it's not clear. It would be great if there is an example.

On Wed, Apr 3, 2019 at 7:47 AM Xavier Badosa <xba...@gmail.com> wrote:
Yes, you are correct. The flattening method is the row-major order:


As explain in the spec

values are ordered by combination of category dimensions keeping fixed the first categories of the first dimensions and iterating through the categories of the last dimension in the id array (and so forth).

For example, if we have three dimensions (A, B and C) with 3, 2 and 4 categories respectively, the values should be ordered iterating first by the 4 categories of C, then by the 2 categories of B and finally by the 3 categories of A


Maybe the slides (35-65) in this presentation 


can also be useful.

X.

On Tuesday, April 2, 2019 at 5:11:37 PM UTC+2, Duraid Abbas wrote:
I'm having a problem understanding the `value` field because it a one dimensional array. how do i know which dimensions belong to which value? 

If I understand correctly the `value` field is a full cube i.e. it contains a value for each possible dimension combination and the user has to iterate through the dimension values in order to pair the dimensions with values. I'm I right?

--
You received this message because you are subscribed to a topic in the Google Groups "json-stat" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/json-stat/ut1-CxUabwk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to json-stat+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Duraid

unread,
Apr 3, 2019, 10:59:17 AM4/3/19
to json...@googlegroups.com
Actually, after another look, I understand the sparse cube solution. Thanks for your help.
Reply all
Reply to author
Forward
0 new messages