Is it possible to filter an Indicator element (from a data expr) from on a filtered map layer??

160
2
2 weeks ago
JonathanBowes
New Contributor III

I have a category selector that filters a river catchment map layer. This catchment map layer simultaneously filters an "Inspected Farms (point)" map layer. Is it then possible to filter my indicator, sourced from a data expression, with common fields with the inspected farm layer ??

Can't seem to get this working and is likely operator error!

Thanks for any pointers,

Jonathan

0 Kudos
2 Replies
jcarlson
MVP Esteemed Contributor

You ought to be able to filter any widget, provided there are shared fields for the filter to act on. Whatever that category selector is using as its filter, make sure that field is available in your data expression output.

Can you share the data expression?

- Josh Carlson
Kendall County GIS
0 Kudos
JonathanBowes
New Contributor III

Thanks @jcarlson,

For clarity I don't have a direct common field linkage between the catchment layer I use as a category selector and the Data Expression feeding my Indicator. It is a "chain or nested" linkage - so the catchment selector filters the "inspected farms" map layer and this layer has a common field linkage to the data expression in the indicator. I was hoping to be able to trigger filtering on the indicator data expression from the changes in inspected farms layer but from what I read it seem only possible to get this realised via a screen selection after the Catchment category has filtered the inspected farms.

 

JonathanBowes_1-1716202341175.png

 

I hoped to do this via the "Layer actions" tab in the map settings but this seems to be sticking point below. I have to use Lasso tool to make manual screen selection to get the indicator to filter further down rather it being a 1 step process. Maybe it's not possible this way.

JonathanBowes_2-1716202471129.png

Thanks for any pointers.

Jonathan

Data Expression below:

//this code declares 2 featuresets for ALL point and line Farm issues,
//establishes a new empty dictionary with farmcode, status, FA_ID and tracking data as fields, empty geometry
//then it loops through PointNCs (points) and adds the each item to the dictionary
//repeats this on LineNCs appending to the same dictionary. finally it then pushes the dictionary
//into 1 featureset so that all point and line issues (farmcode, FAStatus, status, FA_ID and tracking) are together.
//Final step is to Filter the featureset depedning on what we are interested in
// Dashbaord data expressions need to return featuresets

var LineNCs = FeatureSetByPortalItem(Portal('https://www.arcgis.com'),'2c33f11c25b24d72a40d77b618d446f1', 0, ['Status', 'FarmCode','FAStatus', 'created_user','created_date', 'FA_ID'],false)
var PointNCs = FeatureSetByPortalItem(Portal('https://www.arcgis.com'),'8e33c2e866cf4c358c2aa54f8d8e3a7a', 0, ['Status', 'FarmCode', 'FAStatus', 'created_user','created_date','FA_ID'],false)

// return fs3
var FSDict = {
  fields: [{alias: "FarmCode", name: "FarmCode", type: "esriFieldTypeString"},
            {alias: "Status", name: "Status", type: "esriFieldTypeString"},
            {alias: "FAStatus", name: "FAStatus", type: "esriFieldTypeSmallInteger"},
            {alias: "CreatedUser", name: "CreatedUser", type: "esriFieldTypeString"},
            {alias: "CreatedDate", name: "CreatedDate", type: "esriFieldTypeDate"},
            {alias: "FA_ID", name: "FA_ID", type: "esriFieldTypeGUID"}
            ],
  geometryType: "",
  features: []
}    
//return FSDict
//
for (var F in LineNCs){
  Push(
    FSDict['features'],
    {
        attributes: {
            FarmCode: F['FarmCode'],
            Status: F['Status'],
            FAStatus: F['FAStatus'],
            CreatedUser: F['created_user'],
            CreatedDate: F['created_date'],
            FA_ID: F['FA_ID']}}
  )
};
//return Count(FeatureSet(FSDict))

for (var F in PointNCs){
  Push(
    FSDict['features'],
    {
        attributes: {
            FarmCode: F['FarmCode'],
            Status: F['Status'],
            FAStatus: F['FAStatus'],
            CreatedUser: F['created_user'],
            CreatedDate: F['created_date'],
            FA_ID: F['FA_ID']}}
  )
}


var NCs = FeatureSet(FSDict)
var NCsONly = Filter(NCs, 'Status<3')
//return Count(Distinct(ADVONly,'FarmCode'))
return NCsONly

 

 

 

0 Kudos