내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
해결됨

How to implement AVG in a calculated column in reports?

Avatar

Level 1

I'm trying to calculate the average of projects that achieved the SLA Target. I managed to transform the SLA Achieved field into 100 (achieved) and 0 (not achieved), but when I try to aggregate this column for an average of all projects, I cannot do this. I would like to use this aggregator to use them in a Gauge graph. Any idea where I went wrong?

 

displayname=SLA %
linkedname=direct
namekey=SLA Achieved
querysort=DE:SLA Achieved
textmode=true
valueexpression=IF({DE:SLA Achieved}="Yes",100,0)
valueformat=customNumberAsString

aggregator.displayformat=customNumberAsString
aggregator.function=AVG
aggregator.namekey=SLA Achieved
aggregator.valuefield=DE:SLA Achieved
aggregator.valueformat=customNumberAsDouble

주제

토픽은 커뮤니티 콘텐츠를 분류하여 관련성 있는 콘텐츠를 찾는 데 도움이 됩니다.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

It can be done. I didn't catch something on your code. The aggregator valuefield also needs to be an expression.

 

 

Try this:

 

aggregator.displayformat=customNumberAsString
aggregator.function=AVG
aggregator.namekey=DE:SLA Achieved
aggregator.valueexpression=IF({DE:SLA Achieved}="Yes",100,0)
aggregator.valueformat=val
displayname=SLA %
textmode=true
valueexpression=IF({DE:SLA Achieved}="Yes",100,0)
valueformat=customNumberAsString




원본 게시물의 솔루션 보기

6 답변 개

Avatar

Community Advisor

Try changing your aggregator.valueformat and aggregator.displayformat to something else like int or val and see if that works.

 

one thing to note, you can't use text mode columns in the chart reports. You might need to do a calculate field instead of column and have it live on your object.




Avatar

Level 1

Hi Kellie. Thanks for replying.

Unfortunately it doesn't working. Do you have any idea how can I see an average of SLA on the grouping line?

Avatar

Community Advisor

Is the field setup as a number field on the backend? 

KellieGardner_0-1710348056283.png

 




Avatar

Level 1

It's set to text (Y or N), but I'm converting it to a number (see below the valueexpression). Once this is done, I can see the average SLA achieved for the service (e.g. 94%, etc.).

 

valueexpression=IF({DE:SLA Achieved}="Yes",100,0)

 

Do you have any idea whether this possible to be done?

Avatar

정확한 답변 작성자:
Community Advisor

It can be done. I didn't catch something on your code. The aggregator valuefield also needs to be an expression.

 

 

Try this:

 

aggregator.displayformat=customNumberAsString
aggregator.function=AVG
aggregator.namekey=DE:SLA Achieved
aggregator.valueexpression=IF({DE:SLA Achieved}="Yes",100,0)
aggregator.valueformat=val
displayname=SLA %
textmode=true
valueexpression=IF({DE:SLA Achieved}="Yes",100,0)
valueformat=customNumberAsString




Avatar

Level 1

Bingo!!!

Thanks Kellie! Great call... one more learning in my journey in Workfront!