Can you use dynamic spatial parameters?

Kyle set this challenge while I was on my holidays. And because I was away and short on time, I’m cheating a bit this week. I’m not going to provide a full solution guide, but am writing this blog to maintain consistency 🙂

The challenge was very specific to just the new dynamic spatial parameters feature, which is well documented. I used these two resources to familiarise myself with the feature and to build the challenge

My District map sheet referencing the School_District_Characteristics data source looked as below

My Schools map sheet referencing the School_Neighbourhood_Poverty data source, looked as below

where Filter View is a boolean calculated field

INTERSECTS([pViewport], [Geometry])

and pViewport is the dynamic spatial paremeter

My published viz is here.

Note – I did find both on Desktop and Tableau Public that the interactivity was very “laggy”

Happy vizzin’!

Donna

Can you use spatial parameters?

This week, Kyle set the challenge to test our use of functionality released in 2024.3 – spatial parameters. I hadn’t used these before, so did have a watch of the video link posted in the challenge, which was really useful.

Accessing the data

Kyle provided two links to web pages for the data. You need to download the zipped Shapefile from each

Once downloaded, extract each zip file. There will be a SHP (shape) file in each set of unpackaged files. In Tableau desktop, you will need to create 2 connections to a spatial file, one to each shp file

Build the State Map

From the School_District_Characteristics data source, double click on Geometry to automatically create a map.

Add Lea Name to the Detail shelf and add Statename to the Filter shelf, and select Washington.

From the Map menu, select Background Maps > Dark to set the background.

Name the sheet State or similar.

Building the District Map

On a new sheet, double click on Geometry from the School_Neighbourhood_Poverty_Estimates data source to automatically create another map.

Add Name to Detail.

On the Map menu, select Background Layers, and then set the Style to dark and tick the Street,Highways etc option.

Name the sheet District or similar.

Create the spatial parameter and filter

Create a new parameter to store the geometric data

pLea

a spatial parameter, defaulted to Empty

In the School_Neighbourhood_Poverty_Estimates data source, create a calculated filed

Filter

INTERSECTS([pLea],[Geometry])

this will return true if the geometric data that represents the state(s) selected from the state map overlap with the geometric data that represents the schools.

Adding the interactivity

Create a dashboard, placing the State and the District sheets side by side in a horizontal layout container.

Create a dashboard parameter action

Set Lea

On select of the State sheet, set the pLea parameter passing in the value from the Geometry field. Set the value to Empty when the selection is cleared.

Click on the State map (which will populate the pLea parameter). Then navigate back to the District sheet and add the Filter calculation to the Filter shelf and select True, which will result in the District map being filtered

Return to the dashboard and click on the State map to see the District map change.

When no states are selected though, the District map is empty, which is the desired behaviour, but we want to fill the display with the State map (ie hide the space where the District map is).

To do this, create a calculated field (in either of the data sources)

State Selected

NOT ISNULL([pLea])

This will return True if there is something in the pLea parameter.

Back on the dashboard, select the District object on the dashboard, then from the Layout tab, check the Control visibility using value checkbox, and select the State Selected field

Remove the title from the District sheet on the dashboard, and now when all states are unselected the State sheet fills the view.

Finalise the dashboard by adding the title and any other information required. Set the background of the dashboard to dark grey and show the State parameter.

My published viz is here.

Happy vizzin’!

Donna