Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am working on a Word report where I need to display tables related to different kinds of goods with different properties. Hence the tables have different columns.
I have the additional requirements that the report should not show empty tables and that I can fix the width of a column (certain columns I do not want to wrap their text, others I don't mind). I am having trouble to get this to work.
I have considered:
The second idea is more convenient from the development perspective, since there are quite a number of different categories and many columns appear in multiple categories.
Does anyone know how to hide empty tables, format dynamic tables or prevent text-wrap? Any help is very much appreciated.
I am on NPrinting 25.5.5.0 and QlikSense May 2025.
it sort of helps to understand the issue, but that still does not explain how many total columns you may have... If number is limited then if should be rather easy exercise. The only tricky bit is that you need to do dynamic measures. In my example I assumed I could have variable number of measure columns from 1 to 4.
I have created a table which has dynamic measures. (please inspect expressions of those measures in attached qvf file)
I have also created 4 levels which depending on how many columns I need produce a record or remain empty. That way I can insert in each of those levels dedicated table with required number of columns.
Since those are inside levels they will only get populated if they meet threshold.
See below how Qlik Sense app interacts with selections and how dynamic columns represent only required data and only one level per category returns value.
Result: This is GIF so right click on it and open in new window to be able to see it better
I am attaching App and report template for you to play with.
That should make it very straight forward.
cheers
Lech
this is very specific issue and sorry but we may need bit more details regarding layout and data with some mockups of how source data looks like and how your final output needs to look like.
The answer to your question will depend on variability of the number of columns, whether your categories need to be shown in particular order etc.
I was thinking about suggesting you mix solution: multiple levels for multiple categories. Each level would only return table with predefined number of columns which you could individually format.
Hi @Lech_Miszkiewicz, thank you for your reply. Let me give a mock example with two categories (in reality there are 9, for now) and 4 properties (in reality each category has around 5-7 properties with 3-4 shared among them). In total there are around 30ish columns, so it does not make sense (presentation-wise) to put everything in one big table. The tables are generally short, usually 20 elements or less.
| Category | Meal | Calories | Volume | Weight |
| Drink | Dinner time | 200 | 330 | - |
| Food | Lunch | 300 | - | 600 |
| Food | Breakfast | 250 | - | 300 |
| Drink | Lunch | 400 | 500 | - |
In this case I want the report to show, in this order:
Table 1: Drink
| Meal | Calories | Volume |
| Dinner time | 200 | 330 |
| Lunch | 400 | 500 |
Table 2: Food
| Meal | Calories | Weight |
| Lunch | 300 | 600 |
| Breakfast | 250 | 300 |
(In this analogy, I want to make sure that the "Meal" column is sufficiently wide so that "Dinner time" does not line-wrap).
If instead the data is as follows (i.e. there is only food, no drinks):
| Category | Meal | Calories | Volume | Weight |
| Food | Breakfast | 200 | - | 400 |
| Food | Lunch | 300 | - | 600 |
| Food | Breakfast | 250 | - | 300 |
then it should skip the drinks table and immediately show
Table 1: Food
| Meal | Calories | Weight |
| Breakfast | 200 | 400 |
| Lunch | 300 | 600 |
| Breakfast | 250 | 300 |
I do not want a placeholder table like so:
Table 1: Drinks
| Meal | Calories | Volume |
Table 2: Food
| Meal | Calories | Weight |
| Breakfast | 200 | 400 |
| Lunch | 300 | 600 |
| Breakfast | 250 | 300 |
Is that helpful ? Let me know if there is something else you would like to know.
it sort of helps to understand the issue, but that still does not explain how many total columns you may have... If number is limited then if should be rather easy exercise. The only tricky bit is that you need to do dynamic measures. In my example I assumed I could have variable number of measure columns from 1 to 4.
I have created a table which has dynamic measures. (please inspect expressions of those measures in attached qvf file)
I have also created 4 levels which depending on how many columns I need produce a record or remain empty. That way I can insert in each of those levels dedicated table with required number of columns.
Since those are inside levels they will only get populated if they meet threshold.
See below how Qlik Sense app interacts with selections and how dynamic columns represent only required data and only one level per category returns value.
Result: This is GIF so right click on it and open in new window to be able to see it better
I am attaching App and report template for you to play with.
That should make it very straight forward.
cheers
Lech
Thank you very much for this in-depth explanation. I already have a big table with all the data in it, as well as fields that only populate for one category. I did some testing, and your solution can be implemented without too much hassle, while giving me all the table formatting tools I need.
More generally this approach could be considered a way to conditionally show/hide elements in a report, which I hadn't realised so far. Usually levels are talked about in terms of cycling through multiple values, not as a 0-1 thing. I suppose I didn't look in the right places.
Thank you!
Yes, you are absolutely right-levels are not considered as binary show/hide feature. At the same time it is all about understanding how things work and power of coming with workaround like this one.
anyway. I am glad i could inspire you with this different approach and that it could be of any help for you.
cheers
Lech