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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Christinedv
Contributor
Contributor

Trellis container limit on charts

I’m currently working on a Qlik Sense dashboard and I have a Trellis container that shows several bar charts. Each chart uses the Section dimension, and the goal is to display only the top 6 Section values, based on the count of StudentID. Essentially, I want to limit the charts to only show the most relevant Section values, but they should only appear if there’s actual data for those values.

The issue I'm facing is that Qlik doesn't seem to work properly if there is a If() in the dimension of the Trellis container. It does show all the charts for different values of the dimension but the data is the same in all the charts, because the selection is not working with the If() in the dimension field. When I only have Section in the dimension, it does make the correct selection for the charts.

The other issue I’m facing is that the bar charts are still being displayed even when there’s no data for the value of Section. I want the chart to completely disappear if there’s no data for a particular Section value. I’ve tried applying the Rank() function to rank the Section values by the count of StudentID, but I’m still seeing charts that have no data.

What I’m really hoping to figure out is how to make the individual charts hide when there’s no data for the selected Section dimension. I also want to ensure that only the top 6 values are shown based on their rank, but only if there’s data for those values. 

Any advice or insights are appreciated

Labels (1)
1 Solution

Accepted Solutions
DanielC
Employee
Employee

Hi Christine

 

If I’m not wrong you have to do the following:

 

  1. In the master item where you are having the main calculation set the expression as Count($(vDimSetFull) StudentID). Note that if you have already a set analysis, you will need other variable.
  2. On trellis container, activate the Advance Mode in Appearance -> Trellis options
  3. In the same place, set the Maximum number of charts as Count(Aggr(If(Count(StudentID)>0,Section),Section))+rand()
  4. In the Dimension set the Calculated Dimension to On and set the Base Dimension as Section.
  5. Finally, the value of the dimension needs to be Aggr(If(Count(StudentID)>0 and rank(Count(StudentID))<=6, Section), Section)

 

It is a bit complicated but this should erase the charts with no data and display the top 6 ones. Let me know if it works since maybe I did a typo mistake in some of the formulas.

 

Kind Regard

Daniel

View solution in original post

2 Replies
DanielC
Employee
Employee

Hi Christine

 

If I’m not wrong you have to do the following:

 

  1. In the master item where you are having the main calculation set the expression as Count($(vDimSetFull) StudentID). Note that if you have already a set analysis, you will need other variable.
  2. On trellis container, activate the Advance Mode in Appearance -> Trellis options
  3. In the same place, set the Maximum number of charts as Count(Aggr(If(Count(StudentID)>0,Section),Section))+rand()
  4. In the Dimension set the Calculated Dimension to On and set the Base Dimension as Section.
  5. Finally, the value of the dimension needs to be Aggr(If(Count(StudentID)>0 and rank(Count(StudentID))<=6, Section), Section)

 

It is a bit complicated but this should erase the charts with no data and display the top 6 ones. Let me know if it works since maybe I did a typo mistake in some of the formulas.

 

Kind Regard

Daniel

Christinedv
Contributor
Contributor
Author

Hello Daniel,

This worked! thank you

I was still getting the max number of charts error from 3. but i deleted it and still got the result i wanted. 🙂