Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Issues with Aggr function

I need to calculate the resource count for a particular month where the effort (HCM) of that resource is spread across projects. When the total effort of the resource is <=0.7. This gets categorized under limit and if the effort of the resource across projects is >0.7 then it is categorized as Above limit. Second aspect to consider is the Plantype.

As long as the project month is prior to current month we need to consider Actuals as Plantype and Allocations if its current month and beyond while considering the effort (HCM)

I have grouped efffort(HCM) using Resource id across projects to calculate the sum of HCM.

Issue that I am facing is when I select only May 2016 I get the correct values as shown in the attachment May 2016. But when i select multiple months these values are getting reduced as pasted in graph May & June 2016

Can anybody please explain whats going wrong with my expression?

For Under limit -


count(if(monthname(Date#(ProjectMonth, 'MMM-YYYY'))< MonthName(today()) and aggr(sum({<PlanType={'Actuals'}>}HCM),[Resource ID] )<=0.7, [Resource ID],
if(monthname(Date#(ProjectMonth, 'MMM-YYYY'))>= MonthName(today()) and aggr(sum({<PlanType={'Allocation'}>}HCM),[Resource ID] )<=0.7, [Resource ID]
  )
))

For Above limit -

count(if(monthname(Date#(ProjectMonth, 'MMM-YYYY'))< MonthName(today()) and aggr(sum({<PlanType={'Actuals'}>}HCM),[Resource ID] )>0.7, [Resource ID],
if(monthname(Date#(ProjectMonth, 'MMM-YYYY'))>= MonthName(today()) and aggr(sum({<PlanType={'Allocation'}>}HCM),[Resource ID] )>0.7, [Resource ID]

)

))

1 Solution

Accepted Solutions
PrashantSangle

Hi,

try adding monthYear field which you are selecting in aggr()

like

aggr(YourExpression,dim1,monthYear)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

View solution in original post

2 Replies
PrashantSangle

Hi,

try adding monthYear field which you are selecting in aggr()

like

aggr(YourExpression,dim1,monthYear)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Anonymous
Not applicable
Author

Thanks..It worked by includingProjectMonth in the aggr function