Select to view content in your preferred language

reference multiple values in an Indicator

594
4
Jump to solution
02-09-2024 02:01 PM
clt_cabq
Regular Contributor

I'd like to be able to display the number of 'unsafe' buildings our inspection team 'clears' in terms of the number of buildings cleared cumulatively in the current year, the current month, and last month. I can do this using 3 separate indicators, as in the screen shot below, but would like to see if there is a way to do this in a single widget. 

clt_cabq_0-1707515942206.png

 

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You can't put line breaks into an indicator, so you could do something like this:

indicator1.png

But honestly, that isn't the most intuitive presentation of data. A better one might be a Details element, which you could configure like this

indicator2.png

View solution in original post

0 Kudos
4 Replies
KenBuja
MVP Esteemed Contributor

You can't put line breaks into an indicator, so you could do something like this:

indicator1.png

But honestly, that isn't the most intuitive presentation of data. A better one might be a Details element, which you could configure like this

indicator2.png

0 Kudos
clt_cabq
Regular Contributor

@KenR , thanks - Are you using a data expression to add those additional values into either the indicator or the detail widget?

0 Kudos
KenBuja
MVP Esteemed Contributor

Yes, this is using a Data Expression. It would look something like this

var p = Portal("https://arcgis.com");
var poles = FeatureSetByPortalItem(p, yourItemID, 0);

//your code to set variables thisYearValue, thisMonthValue, and lastMonthValue

var jsonDictionarySTART = {
  fields: [{
    alias: "This Year",
    name: "THISYEAR",
    type: "esriFieldTypeInteger",
  },
  {
    alias: "This Month",
    name: "THISMONTH",
    type: "esriFieldTypeInteger",
  },
  {
    alias: "Last Month",
    name: "LASTMONTH",
    type: "esriFieldTypeInteger",
  },
  ],
  spatialReference: { wkid: 4326 },
  geometryType: "esriGeometryPoint",
  features: [{
     attributes: {
      THISYEAR: thisYearValue,
      THISMONTH: thisMonthValue,
      LASTMONTH: lastMonthValue
    },
  }]
};
 
return FeatureSet(Text(jsonDictionarySTART));
clt_cabq
Regular Contributor

Ok, that makes sense, I didn't see any other way to insert multiple values as you did. 

0 Kudos