Select to view content in your preferred language

Arcade Expressions with "No Data"

619
1
08-09-2023 04:58 PM
Labels (1)
DerekKonofalski
Frequent Contributor

I have a Dashboard that I've set up for a team where I'm attempting to add an indicator element that calculates a dollar amount based on the team's submissions. The indicator should say the dollar amount, no matter what but, because the team simply doesn't fill in the dollar amount when there is no entry, my indicator keeps showing "No Data" instead. I've tried to craft an expression to return the string when there's no data for that column but it's not working. It always says "No Data" no matter what.

Here's what I've attempted:

 

 

 

var amount = Iif(IsEmpty($datapoint.sum_dollar_amount), 0, $datapoint.sum_dollar_amount);

 

 

and

 

 

if(IsEmpty($datapoint.sum_dollar_amount)){
   amount = 0;
} else {
   amount = $datapoint.sum_dollar_amount
}

 

 

 

My understanding is that this should return the '0' so that the "${value}" tag in the indicator should show "$0" when the field is null or empty but neither of these work. Since that's the case, what should I be entering as the arcade expression and what should I enter for the 'MiddleText' value of the indicator?

0 Kudos
1 Reply
EH_Alaska
Regular Contributor

Hi @DerekKonofalski! This isn't an Arcade solution, but still a possible solution to your problem. In your Indicator configuration settings, under General, there is a "No Data" section. You can add a label that will show in place of the "No Data" label that you're seeing. Here's how it looks when I try it:

Indicator.PNG