Conditional formatting using calculated field

I am trying to create a scatter plot chart with a list of cases older than 30, 60, and 90 days. I would like to show all the above-mentioned day’s buckets in separate colors. under 30 in grey, above 30 in yellow, above 60 in orange, and above 90 in red.

I have tried this calculation, but it only shows less than 30 & older than 30 days.

ifelse({caseAge} > 60, "Above 60 Days",
ifelse({caseAge} > 90, "Above 90 Days", 
 ifelse({caseAge} >= 90, "Above 90 Days", 
"Below 30 Days"

)))

image

Hi @bizviz

Welcome to the community!

Could you please try the following calculated field.

When you display different colors for different age buckets in your scatter plot, you should adjust your ifelse calculation logic to correctly categorize each bucket.

Example : Calculated field is created with sample data

ifelse({Age} > 90, "Above 90 Days",
ifelse({Age} > 60, "Above 60 Days",
ifelse({Age} > 30, "Above 30 Days", 
"Below 30 Days"
)))

image

1 Like

Thank you @Xclipse.

The calculation worked. However, the above 60-day bucket is not working. Also is there a way to sort the color legends? below 30, above 30, above 60, above 90 ?

Hi @bizviz

Calculated field conditions are working fine, and I tested them with the sample data. It could be a data issue that is preventing you from seeing the ‘Above 60 Days’ bucket. Sorting is not supported in the scatter plot.

Please refer the below documentation this might be helpful for you.

1 Like

I tried this with data with the sample data on this [analysis](Conditional formatting. )

The same issue is occurring. Although, the max days here is 12. However, the only bucket shows up using the calculation is above 9 days. I am sorry, I am stuck on this one.

Hi @bizviz

The data you uploaded is all above 9 days, which is why it’s showing only one bucket.

I adjusted the calculated field to show different buckets.

Example : Age Bucket

ifelse({dateDiff Ship&Order Date} >= 3 AND {dateDiff Ship&Order Date} < 6, "Above 3 Days",
ifelse({dateDiff Ship&Order Date} >= 6 AND {dateDiff Ship&Order Date} < 9, "Above 6 Days",
ifelse({dateDiff Ship&Order Date} >= 9 AND {dateDiff Ship&Order Date} < 12, "Above 9 Days",
ifelse({dateDiff Ship&Order Date} >= 12 AND {dateDiff Ship&Order Date} < 15, "Above 12 Days",
ifelse({dateDiff Ship&Order Date} >= 15, "Above 15 Days", 
"Below 3 Days"
)))))

image

Hope this helps!

1 Like