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: 
Enriquemmesteo
Creator
Creator

Adjust measure to FY/MONTH time dimension

Hello everyone,

I have a line chart with time as a dimension (in months or Fiscal Years depending on a button changing the value of a variable).

The measure is simple...we want to get the hours per person that we have for each month or year. We do this by adding all the hours and dividing them by the distinct names of the people we have in the field name.

It's : sum(hours)/count(distinct(name))

For each month, this is accurate because there aren't many changes between personnel...but when you select to visualize the chart yearly, it occurs that one month one person will leave and another one will be hired. This makes the measure to divide the number of hours by more people than it should because even though there are 2 distinct names...there has only been one worker hired.

What I want to achieve is....when the yearly visualization is selected it should add what the measure gave for all the months each year. 

Thanks in advance!

Labels (2)
1 Reply
Enriquemmesteo
Creator
Creator
Author

I think we need to use the aggr() function for this but I can't get it working correctly