Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Hani
Partner - Contributor II
Partner - Contributor II

Add values for each project

Hi,  I have a  Qlik Sense Server April  2020 Version,  I have a standard table with dimensions project, date, employee, month, total, and hours.
I am using the expression below to color the background,

if([Total] > sum(hours), red(),green())

The problem I am having is it calculates the hours for each employee for each row. What I want is to sum up, each employee's hours for each project.
Expected Back Ground Color::

Qlik.PNG


For example, the background color for project AAA for Nov should be green because the sum of hours for each employee for November is 21 so 21 is greater than 16

 

 

Labels (1)
3 Replies
QFabian
Specialist III
Specialist III

Hi,

1.- try tooking off the 'Project' Dimension

2.- try adding aggr to your expression : if([Total] > sum(aggr(sum(hours), Employee)), red(),green())

QFabian
Anil_Babu_Samineni

Perhaps this?

if([Total] > sum(TOTAL <Project, Employee> hours), red(),green())

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Hani
Partner - Contributor II
Partner - Contributor II
Author

Thank you reply. The expression does not work correctly. For some rows of the same month and the same project, it combines red and green background colors.

 

The screenshot below is filtered by one project.

 

 

Capture.PNG