I have created three columns to show the 25, 50, 75th percentiles in my data. I am now trying to compare one field to these values in an ifelse statement but am getting errors (even when just doing one part, getting the below 25th percentile)

ifelse({Sales}<{Percent25},‘Below 25%’,NULL)

Percent25 is itself a calculated field aggregated at a country and reporting week level.

I get the error that the calculations can’t contain both aggregate and non-aggregated field. How can i fix this?

Yes, I just want to compare each row of a table to the percents. I can get the first value part of your calculation to work, but once i place within the ifelse i get “The calculation operated on Level Aware Calculations agg expressions is not valid”.

While I usually default to the LAC-A expressions because they roll up more nicely, sometimes I revert to the LAC-W functions in cases where I get this error. Try doing something similar with percentileOver formulas (note that these result in a non-aggregated value, so when doing comparisons make sure your other field is non-aggregated, or need to aggregate both to ensure that all fields are either aggregated or non-aggregated in the same calc.