英文:
Unable to aggregate on department level when I select an employee from filter
问题
我正在制作一个Tableau仪表板,我想在一个工作表中显示员工的工资,并在同一个仪表板的另一个工作表中显示该员工所在部门的平均工资。所以它将如下所示:
员工 工资 部门 部门平均工资
Jessica 1000 市场营销 1200
Robert 2800 IT 2460
当我从员工筛选器中选择Jessica时,它会显示Jessica的工资以及Jessica所在部门的平均工资,Robert也是一样。
我想进行分析并比较每个个体的工资与整个部门的平均工资。现在我想知道是否可以在不使用参数的情况下实现这一目标。因为如果我使用参数,每当新员工注册时,我都必须更新参数(我们每季度有数百名员工注册)。
如果参数是唯一的选择,那么我也可以使用。但是否有人能帮助我实现这一目标?
我尝试使用筛选器,但似乎无法避免使用参数。即使使用参数,我仍然无法实现它,所以我需要一些帮助。
英文:
I am working on a Tableau dashboard in which I want to show an employee's salary in one sheet and the average salary of that employee's department in another sheet in the same dashboard. So it will look like below
Employee Salary Department DepartmentAvgSalary
Jessica 1000 Marketing 1200
Robert 2800 IT 2460
When I select Jessica from the Employee filter, it shows me Jessica's salary along with Jessica's department average and the same goes for Robert.
I want to do an analysis and compare each individual's salary vs the whole department's average. Now I want to know if this can be achieved without using parameters. Because if I use parameters, I will have to update the parameter each time a new employee signs up (we have hundreds sign up each quarter).
If the parameter is the only option then I can use that as well. But can anyone help me achieve this?
I tried using filters but it looks like I can't avoid parameters. I still can't achieve it with the parameters so I need some help here.
答案1
得分: 1
阅读文档以了解有关详细程度(LOD)计算的信息。
您可以使用一个固定的LOD计算来计算每个部门的平均工资。将LOD计算视为一个在空间中预先计算的小表,基于您指定的详细级别(例如按部门)的数据。然后它会隐式与您的原始数据连接,以便您可以看到个体值(Jessica的工资)以及相应的聚合值(Jessica所在部门的平均工资)。
可以从数据库表加载参数的有效值列表,以避免手动输入它们,但我不明白为什么在这种情况下需要使用参数。
英文:
Read the documentation to learn about level of detail (LOD) calculations.
You can use a fixed LOD calc to calculate the avg(salary) per department. Think of an LOD calc as a little table out in space that is precomputed based on your data at the level of detail you specify - such as per dept. Then it is implicitly joined with your original data, so that you can see the individual value (Jessica's salary) along with the corresponding aggregate value (the avg salary for Jessica's department)
It is possible to have the list of valid values for a parameter loaded from a database table to avoid entering them by hand, but I don't see why you'd need to use a parameter in this case.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论