Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
reporting_neu
Creator III
Creator III

Cannot filter at Total

Hello, I would like to display the following dimensions in a table:

  • Year
  • Center
  • Employees

And the following key figures for the last three years:

  • Sales of all centers per year
  • Sales per center per year
  • Sales per employee per year

I calculated the key figure for "Sales per employee per year" using the following formula:

Sales per employee per year

SUM({
    < V_BelegPos.offen = {0},
      V_BelegPos.BelegArt = {"R","G"},
      V_BelegKopf.AuftragsArt = {""},
      MASTER_CAL.Year = {">=$(=Year(Today())-2)<=$(=Year(Today()))"}
    >
} V_BelegPos.pA_Gesamtpreis_HW
)

The formula works and I can filter the dimensions as I wish.

Now I would like to calculate the turnover per center and year and have used the following formula:

Sales per center per year

Sum(Total <[MASTER_CAL.Year], [V_BelegKopfVert.Center]>
  {
    < V_BelegPos.offen = {0},
      V_BelegPos.BelegArt = {"R","G"},
      V_BelegKopf.AuftragsArt = {""},
      MASTER_CAL.Year = {">=$(=Year(Today())-2)<=$(=Year(Today()))"}
      >
  }
  V_BelegPos.pA_Gesamtpreis_HW
)

The calculation works so far, but I can't make any further selections from this point on. For example, if I select a year, all the years remain the same. Only the values ​​change to 0.

If I filter for an employee, only that employee is selected. BUT: There's a negative side effect – my second problem. The total value of the center changes due to the selection, which shouldn't be happening.

Can anyone help me with both of these problems?

  • Enable filtering on all dimensions
  • The values ​​don't change when a dimension is filtered

I hope you can help me 🙂 

Labels (5)
13 Replies
reporting_neu
Creator III
Creator III
Author

Okay, thanks for your feedback.

I'll show you the formulas.

 

Total for year

SUM(TOTAL <Year> SALES)

 

Total for center

SUM(TOTAL <Year, Center> SALES)

 

Total for employees

SUM(SALES)

 

As long as nothing is selected, everything is fine.

YearSum YearCenterSum CenterEmployeesSum Employees
202520.000North15.000John7.000
202415.000North10.000John8.000
202312.000North8.000John6.000
202520.000East5.000Peter4.000
202415.000East5.000Peter3.000
202312.000East4.000Peter2.000

 

If I select the employee "John":

YearSum YearCenterSum CenterEmployeesSum Employees
20257.000North7.000John7.000
20248.000North8.000John8.000
20236.000North6.000John6.000

 

If I exclude the employees, it is no longer possible to select them accurately.

So I continue to adjust the formula.

 

Total for year

SUM(TOTAL <Year> {<Center=, Employees= >}SALES)​

 

Total for center

SUM(TOTAL <Year, Center> {<Employees= >}SALES)​

 

If I select the employee "John":

YearSum YearCenterSum CenterEmployeesSum Employees
202520.000North15.000John7.000
202415.000North10.000John8.000
202312.000North8.000John6.000
202520.000East5.000Peter0
202415.000East5.000Peter0
202312.000East4.000Peter0

 

If I select the Center "North" and employee "John" :

YearSum YearCenterSum CenterEmployeesSum Employees
202520.000North15.000John7.000
202415.000North10.000John8.000
202312.000North8.000John6.000
202520.000East0Peter0
202415.000East0Peter0
202312.000East0Peter0

 

Do you see the problem?

marcus_sommer

The expectation isn't clear for me - which values should be shown instead of the red ZERO or should these rows entirely removed?

reporting_neu
Creator III
Creator III
Author

Because in this example the value "John" was selected in the "Employee" dimension, all other values ​​should be hidden. However, due to "{<Employees = >}" and  "{<Center =, Employees = >}, the dimensions remain and values ​​are set to zero.

However, if I remove "{<Employee = >}" and "{<Middle =, Employee = >}", the value becomes indented for each dimension when selecting an employee, as in the second table in the last post.

 

marcus_sommer

Ok. I see the total and the set statement ignoring certain selections are conflicting with each other. Solving such scenarios within a single calculation could become quite challenging. Therefore I would try a simpler way by combining two calculations in which one calculates the wanted results and the second one acts as a boolean condition if this result should be displayed or not. This may look like:

sum({< Dim3> } total <Dim1> Field) * sign(sum(Field))