Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr() with set analysis

hi,

   I am making a bar chat which is showing RunTime(y-axis)  V/S  Jobs(x-axis). But there are many Jobs which are running multiple times in a day. There may be possibility that on the same date and time , many jobs are running.

I used the below expression for Average value of RunTime taken by each Job in current week which is giving right value:-

           =sum(aggr(sum(RunTime),Week, Jobs))/ Sum(aggr(Count(Job_Count), Week, Jobs))


But I am getting problem with the expression of Average value of RunTime taken by each Job in previous week. I am using below expression:

=Sum(aggr(sum({$<Week = {" $(=Week(Start_Date - 7)) "}>}RunTime),Week, Jobs))/ Sum(aggr(Count({$<Week = {" $(=Week(Start_Date - 7)) "}>}Job_Count), Week, Jobs)


Can somebody help me to know what is wrong with this expression.

12 Replies
Not applicable
Author

You need to remove Date selection by using aggr ({<Start_Date=, Week=>}

Not applicable
Author

hi Santosh,

I am not getting you. Can you please explain me more. 

Not applicable
Author

=Sum(aggr({<Week=>}sum({$<Week = {" $(=Week(Start_Date - 7)) "}>}RunTime),Week, Jobs))/ Sum(aggr({<Week=>}Count({$<Week = {" $(=Week(Start_Date - 7)) "}>}Job_Count), Week, Jobs)

Not applicable
Author

It is not working. Some syntax error is coming. Can you suggest me something else.

Not applicable
Author

AGGR Problem with Previous month MTD

Please refer to link ,I was having same issue .

It worked for me

Not applicable
Author

I try the below expression

  =Sum({<Week=>}aggr(sum({$<Week = {" $(=Week(Start_Date - 7)) "}>}RunTime),Week, Jobs)) /      Sum({<Week=>}aggr(Count({$<Week = {" $(=Week(Start_Date - 7)) "}>}Job_Count), Week, Jobs)

but I am getting null value.

giacomom
Partner - Contributor III
Partner - Contributor III

Hi Meenakshi,

I think you forgot a ')' parenthesis at the end of the expression.

Regards,

Giacomo

Not applicable
Author

I used the below expression after using ')' parenthesis at the end of the expression. But I am getting null value.

=Sum({<Week=>}aggr(sum({$<Week = {" $(=Week(Start_Date - 7)) "}>}RunTime),Week, Jobs)) /      Sum({<Week=>}aggr(Count({$<Week = {" $(=Week(Start_Date - 7)) "}>}Job_Count), Week, Jobs))

SunilChauhan
Champion
Champion

use sum in place of count .beacuse job count is already a count.try below


Sum({<Week=>}aggr(sum({$<Week = {" $(=Week(Start_Date - 7)) "}>}RunTime),Week, Jobs)) /      Sum({<Week=>}aggr(sum({$<Week = {" $(=Week(Start_Date - 7)) "}>}Job_Count), Week, Jobs)

Sunil Chauhan