Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

AGGR Problem with Previous month MTD

Facing problem in AGGR

I have to calculate Average for sum of previous month (MTD)

and in my scenario I have to write aggr as i cannot directly calculate  avg  ie  i have to do (avg(aggr (sum(),Date,A,B))).

when i Select Calender month the expression is showing null value.

Please Help?

PFA for reference to understand my problem .

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You'll need to override the selection in calMonth in the set analysis expression. Try: avg({<calMonth=>}aggr(sum({<calMonth=, Date={">=$(=addmonths(monthstart(max(Date)),-1))<=$(=addmonths(max(Date),-1))"}>}Sale),Date))


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

You'll need to override the selection in calMonth in the set analysis expression. Try: avg({<calMonth=>}aggr(sum({<calMonth=, Date={">=$(=addmonths(monthstart(max(Date)),-1))<=$(=addmonths(max(Date),-1))"}>}Sale),Date))


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

  I am facing the same problem. Can you please help me for calculating the average the RunTime for each Job in previous month. Can you please go to the below link.

Aggr() with set analysis