Select to view content in your preferred language

Arcade symbology in percentage ranges

1983
6
Jump to solution
12-01-2020 01:46 PM
DianaWilson1
Occasional Contributor

Hi All,


I want to create an arcade expression for symbolization of ratio ranges. I have a field that display ratios like 0.33, 0.60, and greater like 1.0. Then I want the ratios within categories in percentages like from 65% and below, from 66% to 70% and so on and last category from over 96%.

How to accomplish that? Please advice 
Thank you,

0 Kudos
2 Solutions

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Hi @DianaWilson1 ,

 

You can use something like this:

var ratio = $feature.Ratio; // replace by field name in your data

if (ratio <= 0.65) {
    return "less than or equal to 65%";
} else if (ratio <= 0.7) {
    return "from 66% to 70%";
} else if (ratio <= 0.75) {
    return "from 71% to 75%";
} else if (ratio <= 0.8) {
    return "from 76% to 80%";
} else if (ratio <= 0.85) {
    return "from 81% to 85%";
} else if (ratio <= 0.9) {
    return "from 86% to 90%";
} else if (ratio <= 0.95) {
    return "from 91% to 96%";
} else {
    return "96% and higher";
}

 

 

View solution in original post

XanderBakker
Esri Esteemed Contributor

Hi @DianaWilson1 ,

 

I would probably do something like this:

var ratio = $feature["YR1_RATIO"]; // replace by field name in your data

if (IsEmpty(ratio)) {
    return "no data";
} else if (ratio <= 0.65) {
    return "less than or equal to 65%";
} else if (ratio <= 0.7) {
    return "from 66% to 70%";
} else if (ratio <= 0.75) {
    return "from 71% to 75%";
} else if (ratio <= 0.8) {
    return "from 76% to 80%";
} else if (ratio <= 0.85) {
    return "from 81% to 85%";
} else if (ratio <= 0.9) {
    return "from 86% to 90%";
} else if (ratio <= 0.95) {
    return "from 91% to 96%";
} else {
    return "96% and higher";
}

View solution in original post

0 Kudos
6 Replies
XanderBakker
Esri Esteemed Contributor

Hi @DianaWilson1 ,

 

You can use something like this:

var ratio = $feature.Ratio; // replace by field name in your data

if (ratio <= 0.65) {
    return "less than or equal to 65%";
} else if (ratio <= 0.7) {
    return "from 66% to 70%";
} else if (ratio <= 0.75) {
    return "from 71% to 75%";
} else if (ratio <= 0.8) {
    return "from 76% to 80%";
} else if (ratio <= 0.85) {
    return "from 81% to 85%";
} else if (ratio <= 0.9) {
    return "from 86% to 90%";
} else if (ratio <= 0.95) {
    return "from 91% to 96%";
} else {
    return "96% and higher";
}

 

 

DianaWilson1
Occasional Contributor

Alex, 

Thank you so much! I just wonder if you work in my office a long time ago. You put the ratio ranges exactly how I have in my table and I just gave you one range  bracket. 

Best, 

Diana 

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi @DianaWilson1 , 

 

I'm glad it works. The ranges I used just sounded logical. 😉

0 Kudos
DianaWilson1
Occasional Contributor

Hi Alex,

Thank you! I just realized that there are many null values in this field, and all of them fall in the "5% and below" bracket. I try this part in the beginning of the arcade expression, but it does not work. could you please advice how to improve this? thanks

IIF(!IsEmpty($feature.YR1_RATIO){
return""
}else{$feature.YR1_RATIO
}

Thanks,

Diana

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi @DianaWilson1 ,

 

I would probably do something like this:

var ratio = $feature["YR1_RATIO"]; // replace by field name in your data

if (IsEmpty(ratio)) {
    return "no data";
} else if (ratio <= 0.65) {
    return "less than or equal to 65%";
} else if (ratio <= 0.7) {
    return "from 66% to 70%";
} else if (ratio <= 0.75) {
    return "from 71% to 75%";
} else if (ratio <= 0.8) {
    return "from 76% to 80%";
} else if (ratio <= 0.85) {
    return "from 81% to 85%";
} else if (ratio <= 0.9) {
    return "from 86% to 90%";
} else if (ratio <= 0.95) {
    return "from 91% to 96%";
} else {
    return "96% and higher";
}
0 Kudos
DianaWilson1
Occasional Contributor

Thank you!

0 Kudos