Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

required drilldown/cut on geo and year dims, acs #188

Closed
hwchen opened this issue Oct 29, 2018 · 14 comments
Closed

required drilldown/cut on geo and year dims, acs #188

hwchen opened this issue Oct 29, 2018 · 14 comments
Assignees
Labels
question Further information is requested

Comments

@hwchen
Copy link

hwchen commented Oct 29, 2018

A change was made recently (a few weeks ago) where there are no longer default members for geo. Year has never had a default member.

Because of this, not drilling down or cutting on the geo dimension in the acs results in incorrect values.

Below is an example in the massachusetts profile as of 10/27/2018:

00.877 /cubes/acs_ygl_language_spoken_at_home_by_english_ability_1/aggregate?drilldown[]=[Language+Spoken+at+Home].[Language+Spoken+at+Home]&drilldown[]=[Year].[Year]&cut[]={[Year].[Year].[Year].&[2015]}&measures[]=Languages+Spoken&nonempty=true&distinct=false&parents=false&debug=false&sparse=true

Also, it's possible that the vizbuilder will have to handle default values a little differently because of this change.

Sorry about making this change, but the cube is way faster because of the change in structure!

cc @davelandry @cnavarreteliz @frabarz

@davelandry
Copy link
Member

@hwchen for location profiles, we have some queries that look for national comparison values (which is probably what this is). I will go in and add a cut for the US.

@davelandry
Copy link
Member

I only found one instance in the profile where we were querying an ACS table without a Geo cut (the one @hwchen mentioned).

Regarding the vizbuilder, this means that we need to communicate through annotations if a cut is required if not specified. I'm not sure what's the best way to annotate that...

@hwchen
Copy link
Author

hwchen commented Oct 30, 2018

I have a is_required = true annotation in the health cube. Is that sufficient?

health.xml
1-    <Dimension foreignKey="health" name="Health Coverage">
2-      <Annotations>
3-        <Annotation name="is_aggregatable">false</Annotation>
4:        <Annotation name="is_required">true</Annotation>
5-      </Annotations>

@davelandry
Copy link
Member

@frabarz what do you think about this? will this be sufficient for the vizbuider?

@frabarz
Copy link

frabarz commented Nov 2, 2018

I'm not sure if I understand correctly.
Doing a query for certain cubes will require a specific cut to be added to the query?

@jspeis
Copy link
Member

jspeis commented Nov 2, 2018

@frabarz basically if is_required=true is set on a dimension the user of the cube must either cut or drilldown on that dimension -- and if nothing is specified then the simplest thing might be to just add a drilldown on the first hierarchy in the dimension (i.e. Nation in ACS)

@hwchen let me know if that sounds right?

@davelandry
Copy link
Member

davelandry commented Nov 2, 2018

@frabarz so for an example use case:

  • user selects an ACS measure
  • we default them to looking at States (which we currently do)
  • if they change the groupings to not include a Geography grouping, we need to make sure to add a secret group by for Nation in the backend in addition to their other groupings (nothing should be changed on the front-end)

@davelandry
Copy link
Member

On katahdin I only see this implemented for "Health Coverage" in the acs_yghsa_health_coverage_type_by_sex_by_age cubes. @hwchen is that enough for @frabarz to work off of to implement in the vizbuilder?

@hwchen
Copy link
Author

hwchen commented Nov 21, 2018

I think we've discussed this in Slack (unless I remembered incorrectly) that all Geography and Year dims could have the assumption that they need to be drilled down.

I'm going to close this for now, and reopen if this is incorrect and you'd like another behavior.

@hwchen hwchen closed this as completed Nov 21, 2018
@davelandry davelandry reopened this Nov 21, 2018
@davelandry davelandry added the question Further information is requested label Nov 21, 2018
@davelandry
Copy link
Member

Ahh ok, well that's something. I can see where it would be tedious to go in and add that annotation to every dimension.

@frabarz what do you think? should we just do a prop to the React component that lets the users specify additional required dimension drilldowns? We already always drilldown on Year, but in this case we would need to add a fallback "Geography - Nation" drilldown if none is specified by the user.

I'm not sure of how widespread the need for this is across other projects, so that might also dictate the solution here.

@frabarz
Copy link

frabarz commented Nov 22, 2018

If we want the vizbuilder be prepared to handle this for any project, a component property is a good way; if isn't set it just works normally. Configuring it isn't a problem.
However this is something related directly to queries, where if not set the query doesn't work/make sense. In my opinion this is an intented use for annotations (or due to importance, even as a direct attribute), because this config is something that will always be needed to have along the basic cube info when building queries.
With an annotation we could even pass the handling to mondrian-rest-client instead of vizbuilder and enable it in other projects directly.

EDIT: wait a sec, maybe I understood it wrong. Having Years as a required drilldown in vizbuilder is to enable more chart combinations to be shown, as there's more possibilities that make sense, but the queries would still make sense if it doesn't have it, depending on the kind of data we want to retrieve. Is it the same with requiring Geography?

@hwchen
Copy link
Author

hwchen commented Nov 27, 2018

For Years I didn't think that the queries made sense without it?

It's definitely the case that queries to Geography will make no sense without drillingdown/cutting.

So, I guess this means that I should add an annotation for Geography. I'll hold of on years until further notice.

The annotation will be: <Annotation name="is_required">true</Annotation>

@davelandry
Copy link
Member

Yeah, I'm thinking let's not overcomplicate this.

@hwchen please add <Annotation name="is_required">true</Annotation> to any dimension that is required to have at least one of it's levels drilled down

@frabarz you can get going by testing this with the "Health Coverage" cube mentioned above. I've created an issue here: Datawheel/canon#307

@hwchen
Copy link
Author

hwchen commented Dec 6, 2018

I think that I've added the is_required annotation where necessary. Since the general question has been resolved, I'm going to close this issue. Feel free to reopen if you feel there's more to discuss, otherwise for specific cubes please open another issue.

@hwchen hwchen closed this as completed Dec 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants