Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
melissa4
Contributor II
Contributor II

Custom Tooltip for Stacked Bar Charts

I have a stacked bar chart showing number of employees per department.  The value is Count(Employee ID) with 2 drill down dimensions on the Y-Axis:  Department name and Subdepartment name. Then, the bars are stacked by whether they completed a training (Yes or No).

The tooltip shows number of employees that completed the training or not completed the training. However, I want to also show the total number of employees (completed + not completed) for the entire stack according to each Department/Subdepartment.  

This is similar to another community thread but the solution to show Count(TOTAL <Department> Employee ID) did not work for me so am still searching for a solution.  I am using Qlik Sense Enterprise online and cannot attach a qvf. Instead, I hope the attached image helps explain what I mean. Any ideas are welcomed.

Labels (2)
1 Solution

Accepted Solutions
melissa4
Contributor II
Contributor II
Author

I figured out it wasn't working because the field was aliased in script editor:
    Load
         RESULT as 'Completion Status'

So, I loaded RESULT twice in script editor, once as 'Completion Status' for other purposes in my dashboard and another with no alias for the tooltip calculation. Once I excluded selections on the original RESULT field (by encasing in {<>} and setting it = to nothing) it worked and the tooltip displayed the total number of people within the stack, whether they took the training or not. 

   Incorrect Formula:  Count(TOTAL {<Aliased_Field=>} EMPLID)

   Correct Formula:     Count(TOTAL {<Original_Field_No_Alias=>} EMPLID)

View solution in original post

2 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi Melissa,

your count expression seems to have a syntax error. Try to remove the curly brackets and leave it like this:

Count(Total <DEPARTMENT_CODE> EMPLID)

melissa4
Contributor II
Contributor II
Author

I figured out it wasn't working because the field was aliased in script editor:
    Load
         RESULT as 'Completion Status'

So, I loaded RESULT twice in script editor, once as 'Completion Status' for other purposes in my dashboard and another with no alias for the tooltip calculation. Once I excluded selections on the original RESULT field (by encasing in {<>} and setting it = to nothing) it worked and the tooltip displayed the total number of people within the stack, whether they took the training or not. 

   Incorrect Formula:  Count(TOTAL {<Aliased_Field=>} EMPLID)

   Correct Formula:     Count(TOTAL {<Original_Field_No_Alias=>} EMPLID)