Drop down menu for integer columns

783
8
Jump to solution
04-22-2022 10:25 AM
Ed_
by MVP Regular Contributor
MVP Regular Contributor

Good day @Scott_Aulen,

Hope all is well, so Insights does not support adding an integer column in a predefined filter as shown below.

SaadullahBaloch_0-1650647787552.png

 

Now a workaround for this is that I can change the datatype to string and then filter the values, and I can do a selection and show it on a map. But, I can't create other plots such as an histogram and any other exploratory statistics that does not support string data.

Is there a workaround to select an integer column in the filter, so that I can do other exploratory non-spatial analysis as well? 

Question | Analyze | Visualize
0 Kudos
1 Solution

Accepted Solutions
Scott_Aulen
Esri Contributor

In this case, you would be able to create a filter for each integer then and allow users to select.

I agree, @LauraBecht's solution below would probably be the best.  Add each as a separate value through the Advanced filter.

[FIELD] = 1

[FIELD] = 2

[FIELD] = 3

Etc.

View solution in original post

8 Replies
Ian_Muehlenhaus
Esri Contributor

Hi @Ed_,

I actually drafted a blog post about this, as it comes up quite frequently. There is actually a pretty straightforward, quantitative solution if I'm understanding your situation correctly. I'll give you a sneak peak of it here! 🙂

You create a new field that identifies quantitative values from the field of interest that are null -- or any particular value you want. Then you filter on that new field. 

Here is the gist without my animated GIFs and the intro, etc. That's coming soon. 🙂

Thanks for using ArcGIS Insights! And thanks for your questions!

-------


Directions:

  • Click on the dataset containing null values (i.e., “Null Data” in the above animation)
  • Select the dataset menu (three dots) and choose “View data table”
  • Identify the field with null values you would like to filter out (i.e., “Favorite Number” in the above animation)
  • In the Attribute Table, select "+ Field." Your dataset now has a new, blank field.
  • Rename the new field something you can remember to help you find it later (i.e., “FindNulls” in the above animation)
  • With the “FindNulls" field highlighted in the attribute table, go up to the function dialog (the “fx” to the right of the “+ Fields” button)
  • Type "ISNULL" in the function dialog. You will need to select a parameter
  • Click on the field in which you want to find null values (i.e., "Favorite Number" in the above animation)
  • Insights calculates a new "FindNulls" field: 1 = Null value detected. 0 = Numeric value detected
  • Your new FindNulls field is visible in the data pane on the left
  • Click on the FindNulls field in the data plane (i.e., it will probably be the last field option at the bottom)
  • Select the Filter icon on the right-hand side of FindNulls
  • Move the slider to exclude any value over 0 (i.e., any value that is Null)
  • Watch your data table and all accompanying Insights cards magically update to exclude all data points that had null values

The best part – your original dataset remains intact. You can click on the calculated field filter in the data pane and trash the filter to restore your nulls! No damage done.

ISNULL provides an additional benefit for data analysts

There is a different, often overlooked, value to using the ISNULL function. It allows you to gauge the quality of your data sample.

For example, pretend you imported an Excel file into ArcGIS Insights containing over 200,000 data points. Perhaps it’s a file containing global, quarterly, automated, radon-test readings since 2000.

In a medium-sized dataset like this, nulls are inevitable. Using the ISNULL method, you can quickly get a count of “how significant” the null values are in your dataset. Simply examine what percentage of the 200,000 data points come up null. Such information can be handy when scrutinizing the legitimacy of your dataset and your subsequent analysis.

-------------------
Ian Muehlenhaus
Location Analytics
Ian_Muehlenhaus
Esri Contributor

Sorry, quickly saw your post while at a conference and just realized you were talking about predefined filters, not regular filtering. Still, it may come in handy, so I'll leave it be... @Scott_Aulen can probably provide more guidance. 🙂

Have a great weekend, @SaadullahBaloch!

-------------------
Ian Muehlenhaus
Location Analytics
Scott_Aulen
Esri Contributor

Saddullah,

Are you wanting to define a set of integer ranges (ie, 1-3, 4-6, 7-9) and have users toggle between them or have users interact with a numerical slider similar to the Temporal filter widget?

 

Ed_
by MVP Regular Contributor
MVP Regular Contributor

@Scott_Aulen 

So that column has values ranging from 1-10. Thus, the drop down menu will allow the user to select (multi select) which value data points they want to see in the visuals. Hence, basically there will be 10 values to choose from.

Thank you,

Question | Analyze | Visualize
0 Kudos
Scott_Aulen
Esri Contributor

In this case, you would be able to create a filter for each integer then and allow users to select.

I agree, @LauraBecht's solution below would probably be the best.  Add each as a separate value through the Advanced filter.

[FIELD] = 1

[FIELD] = 2

[FIELD] = 3

Etc.

Ed_
by MVP Regular Contributor
MVP Regular Contributor

@Scott_Aulen hope all is well, can you please help me with the exact expression syntax to use? My column name is `floodfactor` and the values are from 1 to 10. 

I did try `floodfactor` = 1 OR `floodfactor` = 2 .... OR `floodfactor` = 10 but this does not show the individual values to be filtered like this:

SaadullahBaloch_0-1651852643170.png

 

Question | Analyze | Visualize
0 Kudos
Ed_
by MVP Regular Contributor
MVP Regular Contributor

@Scott_Aulen or do I need to add them one by one like 

Advance filter >  `floodfactor` = 1 > click add > rename `floordfactor` to `1`.

Advance filter >  `floodfactor` = 2 > click add > rename `floordfactor` to `2`. and so on...

Question | Analyze | Visualize
0 Kudos
LauraBecht
Occasional Contributor

FYI - my way of filtering for integer values is to use an advanced filter in the predefined filter