Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
BarryTay
Contributor
Contributor

Trellis Chart not removing empty values

Hey all,

Been trying to figure this out for a month now, but still nothing. Basically, what I want to do is that for a certain selection (e.g Shop = AA), I want to have all prices shown for the fruits that the shop selection sells. So if the shop sells 5 fruits, then forward prices for all 5 fruits will be shown. If a shop only sells 3 fruits, then only forward prices for those 3 fruits will be shown.

In the trellis container, I can't seem to get this working as the empty charts will still show (e.g Shop = AA shows empty grapes and pineapples). Is there a way to remove those empty charts? Any ideas to circumvent this/a new viz would be most helpful as well 🙂

Thanks in advance!

Labels (2)
6 Replies
ckg
Employee
Employee

Hi @BARN 

This is actually working as designed. You COULD workaround it by doing the following:

1. For the dimension, use an IF formula to determine which dimensions should be shown. Make sure to also select the option Calculated dimension and then select the Base dimension which your IF formula is based off
2. In the setting for Maximum number of charts, you can change this to a random number formula. The random number formula will calculate after each click which will cause the chart to render when you change selections. You can use a formula like this: ROUND((rand()*100000)+1,1) + 100  // The plus 100 is to ensure the charts still render if the random number happens to be below 100

Just a note that you should only do this if you expect to have a normal amount of dimension values as it could end up trying to render a large amount of charts since we are artificially setting the maximum number to a very high number

BarryTay
Contributor
Contributor
Author

Hey CKG,

How would you perform a dynamic filtering as per 1)? Could you kindly show me an example?

 

Barry

ckg
Employee
Employee

You could use something like this as the dimension:

Aggr(Shop, Shop)

Make sure you also set the Calculated dimension switch to on and to select your base dimension as well (Which should = Shop)

BarryTay
Contributor
Contributor
Author

Hey CKG,

I tried your suggestion...it doesn't seem to work...now the charts of the fruits that are not present in all shops (grapes, pineapples) are not shown even if click a shop which sells all 5 fruits (first chart).

BarryTay_1-1671041027210.png

 

Barry

 

ckg
Employee
Employee

Hi @BarryTay 

Can you share an example app?

Thanks

jurajmskch
Partner - Contributor II
Partner - Contributor II

Hi @BarryTay, thanks, it works.