Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jheasley
Luminary Alumni
Luminary Alumni

Aggr Function Help

I am having trouble getting the Total number of hours to aggregate by Time Period.  I need the total hours for a time period to compare to the total number of hours per region and time period. 

Capture.JPG

for Jan 2020 I need each regions Recent Total to show 102, for Dec 2019 I need 176, etc.

I am currently using:

Sum({<[_recent]={1}>}Aggr(Sum({<[_recent]={1}>}timeSpentSeconds_u0),[Worklog Month])/60/60)

if i add the dimension of region, the totals in both columns are the same. 

 

6 Replies
Kushal_Chawda

may be this

Sum(total <[Working Month]>{<[_recent]={1}>}Aggr(Sum({<[_recent]={1}>}timeSpentSeconds_u0),[Worklog Month])/60/60)
juraj_misina
Luminary Alumni
Luminary Alumni

Optionally I think in this case it is legal to use

Sum({<[_recent]={1}>}Aggr(NODISTINCT Sum({<[_recent]={1}>}timeSpentSeconds_u0),[Worklog Month])/60/60)

Hope this helps.

Juraj.

jheasley
Luminary Alumni
Luminary Alumni
Author

same result that i got

jheasley
Luminary Alumni
Luminary Alumni
Author

this didnt work either. attached is the result for both options.

Capture.JPG

lorenzoconforti
Specialist II
Specialist II

I think there might be a spelling mistake in one of the formulas; try


Sum(total <[Worklog Month]>{<[_recent]={1}>}Aggr(Sum({<[_recent]={1}>}timeSpentSeconds_u0),[Worklog Month])/60/60)

juraj_misina
Luminary Alumni
Luminary Alumni

Hi @jheasley Both work for me, see attached app.