Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lailarhc
Creator
Creator

Show only years where percentage different than 0% in bar chart

I have a percentage bar chart that shows the contribution of an employee to the number of courses all employees have taken. I want to only show the years on my chart where an employee's contribution is bigger than 0% (in other words, show only the years where he has taken any courses).

I want to show this across different charts (A chart with the total hours of courses the employee has taken and a chart with the percentage of hours that employee has contributed to the company)

How can I accomplish this?

Here's my chart when an employee is selected:

lailarhc_0-1637580148572.png

 

Here's the expression for the bar height:

=(Sum({$} Aggr(Count({$} distinct [Nome Evento]), [Nome do servidor], [Data.autoCalendar.Year]))) / (Sum({1} Aggr(Count({1} distinct [Nome Evento]), [Nome do servidor], [Data.autoCalendar.Year])))

 

Please let me know if there's any important information missing from this post. Thank you in advance.

----

Edit:

Unchecking the "Include Zero Value" in the Add On tab worked for the first chart. But I have a second chart with two bars:

lailarhc_0-1637586204833.png

 

 

Here's the expression for the blue bar:
(Sum({1} Aggr(Sum({1<[Nome Evento] =- {'null'}>} [Carga Horária]), [Nome Evento], [Nome do servidor], [Data.autoCalendar.Year])))

 

Here's the expression for the purple bar:

(Sum({$} Aggr(Sum({$<[Nome Evento] =- {'null'}>} [Carga Horária]), [Nome Evento], [Nome do servidor], [Data.autoCalendar.Year])))

 

I only want to display the years where the value of the purple bar is different from 0.

2 Replies
mfarsln
Creator II
Creator II

Hi,

Did you try to uncheck 'Include Zero Values' option under the data handling tab?

lailarhc
Creator
Creator
Author

It worked for the first chart. But I have a second chart with two bars:

lailarhc_3-1637586017217.png

 

Here's the expression for the blue bar:
(Sum({1} Aggr(Sum({1<[Nome Evento] =- {'null'}>} [Carga Horária]), [Nome Evento], [Nome do servidor], [Data.autoCalendar.Year])))

 

Here's the expression for the purple bar:

(Sum({$} Aggr(Sum({$<[Nome Evento] =- {'null'}>} [Carga Horária]), [Nome Evento], [Nome do servidor], [Data.autoCalendar.Year])))

 

I only want to display the years where the value of the purple bar is different from 0.