Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have an issue in my code - in a table with a lot of different ID numbers, both male and female, I have to include a column that will measure the average salary for male individuals only, by level and department.
My issue is that in rows where the individuals are female, it shows a null value (-) instead of the male average as I need it.
I'm not sure how to show the male average in rows where the employees are female and have tried everything I could find/think of. This is my basic code.
Aggr(Avg(Total<Department, Level> {<Gender = {'Male'}>} Salary),[ID] ,[Level], [Department], Gender)
Please help me figure it out as I have been looking for it for hours now and need to deliver it ASAP.
Thanks in advance you might save me with this one 😅
you might not need the aggr()
Try without it: Avg(Total<Department, Level> {<Gender = {'Male'}>} Salary)
As a starting point, I'd suggest adding the set analysis to the Aggr(). I'm not sure if that's the issue - hard to guess with no sample data to test on - but that's a common issue with aggregations involving set analysis.
you might not need the aggr()
Try without it: Avg(Total<Department, Level> {<Gender = {'Male'}>} Salary)
That works! Thank you very much.