Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
What I thought would be quite simple is turing out to be trickier than expected and wondered if anyone could help
I have a bar graph which work perfectly well and on the caption of the bar graph i've got it to display the average for the data
'Average Age =' & Round(avg({$< comp_anal.EcStatus = {'Registered'} >}comp_anal.Comp_Age),1)
What i'm now trying to do is turn the bar which pertains to the average a different colour
If I use the background setting on the expression of the chart and set this to an actual value it works fine
=if (comp_anal.Comp_Age =
50
, RGB(64,0,128),RGB (141,170,203))
however
if i now substitute that with the equation im using for the average it turns every bar into the 'yes' value
=if (comp_anal.Comp_Age =
Round(avg({$< comp_anal.EcStatus = {'Registered'}>}comp_anal.Comp_Age),1)
, RGB(64,0,128),RGB (141,170,203))
can anyone recommend anything?
Many thanks
I guess the avg is calculated for each bar here, hence the condition is true for each. Try adding total:
=if (comp_anal.Comp_Age =
Round(avg(total {$< comp_anal.EcStatus = {'Registered'}>}comp_anal.Comp_Age),1)
, RGB(64,0,128),RGB (141,170,203))
If it doesn't help - upload an example.
I guess the avg is calculated for each bar here, hence the condition is true for each. Try adding total:
=if (comp_anal.Comp_Age =
Round(avg(total {$< comp_anal.EcStatus = {'Registered'}>}comp_anal.Comp_Age),1)
, RGB(64,0,128),RGB (141,170,203))
If it doesn't help - upload an example.
you can use variable
var1=Round(sum(if (comp_anal.EcStatus = "Registered",comp_anal.Comp_Age,0))/count(if (comp_anal.EcStatus = "Registered",comp_anal.Comp_Age)))
and the use this variable in expression
PS: check the brackets syntax
Thanks
BKC
thanks Michael
I'm sure Balks worked as well, but Michaels was easier to implement