Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to highlight cells in the field "Total Miles" if the value is less than 10 percentage of average value of total miles grouped by subdivision. I used the following script, but is not working. Please help me to find what is wrong with my code?
if(TOT_MILES < aggr(avg(TOT_MILES), SBDVSN)*.1, Rgb(254,136,133),Rgb(138,245,126))
Thanks.
@Annu Please find the code below:
NoConcatenate
Temp:
load * inline [
Subdivision, totalmiles
Cabs,100
Cabs,150
Cabs,75
Shuttle,140
Shuttle,120
Shuttle,110
VIPpickup,40
VIPpickup,35
VIPpickup,30
];
Exit Script;
if(totalmiles<Avg(total <Subdivision>totalmiles),red(),green())
If this resolves your issue, please like and accept it as a solution.
@Annu Please find the code below:
NoConcatenate
Temp:
load * inline [
Subdivision, totalmiles
Cabs,100
Cabs,150
Cabs,75
Shuttle,140
Shuttle,120
Shuttle,110
VIPpickup,40
VIPpickup,35
VIPpickup,30
];
Exit Script;
if(totalmiles<Avg(total <Subdivision>totalmiles),red(),green())
If this resolves your issue, please like and accept it as a solution.
Yes it worked. Thanks for the code.
I am wondering why the aggr function didn't work as it is a group by function?