onaio / gisida

JavaScript library that converts MapSpec layers to beautiful, interactive maps using Mapbox GL
http://gisida.onalabs.org/
Apache License 2.0
10 stars 3 forks source link

[Filters] Render select_multiple Questions as Unique Values. #250

Open cKellyDesign opened 5 years ago

cKellyDesign commented 5 years ago

Currently, select_multiple questions from ONA forms render all unique combinations of selected values, but this creates a very long (and not very useful list of combinations). As a user, I should see a finite list of unique values as filter options so I may select any combination of values from select_multiples. Coupled with existing functionality basic and advanced filters, this should allow the user to cross-filter any combination of values within an ONA form select_multiple question.

cc @engwiri @csc5k @mberg

cKellyDesign commented 5 years ago

So far so good:

screen shot 2018-12-17 at 5 58 49 pm

Curious that the totals for the select_multiple filter is different than the rest though. Right now the categories in this filter are defined and restricted by the layer's data-parsing config (which is already required simply to ingest this type of question from the API). It's a 2 line change to add new options if form submissions have values unaccounted for in the config.

@engwiri - Any preference on the labeling of this new layer filter? It's the site_activity field from the registration forms, maybe Registered Site Activity?

And it looks like the NU_indicators/facility_type parse config needs to be updated too (onaio/service-mapping#162)

engwiri commented 5 years ago

@cKellyDesign what do you mean the totals for the multiple options? I would imagine they would be double counted because it would be counting some sites twice.

For the name can we call it services provided? I think thats the most relevant name assuming thats the field we are working with.

KipSigei commented 5 years ago

There are some submissions that don't have the services provided question filled, also we have some invalid options in the data. I believe those two things are the reason the options count for the services filter don't match up with the rest.

cKellyDesign commented 5 years ago

@engwiri @KipSigei - It also looks like only the Somalia registration form has the site_activity question, the Somaliland registration form has the select_multiple options in the choices sheet but not the actual question. Also, the site_activity does not (currently) use and other option, so I'm not sure how this invalid data is getting in:

screen shot 2018-12-18 at 9 32 06 am
cKellyDesign commented 5 years ago

Also, @engwiri is right sites are being double/triple counted, in this case there are 1621 combinations for 1123 submissions (547 combos when restricted to site_activity layer data-parse configs). I think that's totally fine.

cKellyDesign commented 4 years ago

@kahama94 @kahummer @samwata Are the requirements around select_multiple filters being satisfied in the most recent work to move nutrition-sites data into Superset?