OT already in calculation, OT=sum({otunits})/sum({onunits}+{latunits})
this year data i use: ifelse(dateDiff({latest_datetime},now(),“YYYY”)=0, OT,0)
last year data i use: ifelse(dateDiff({latest_datetime},now(),“YYYY”)=1, OT,0)
it showed error with “mismatched aggregation. custom aggregations can’t contain both aggregate"sum” and non -aggregated fields “sum{“otunits”}”,in any combination.
thanks so much for your comment!! gave me an idea to fix it.
Successfully calculated as below.
OT_This_Year=sum(ifelse(dateDiff({latest_datetime},now(),“YYYY”)=0,{otunits},0))/sum(ifelse(dateDiff({latest_datetime},now(),“YYYY”)=0,{onunits}+{latunits}),0))