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

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
user_qlik_bga
Contributor II
Contributor II

Format and hide tables in Word template

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:

  • In QlikSense, one table per category and then in NPrinting
    • Drop the entire table into the report. In this case empty tables disappear, but I cannot apply formatting.
    • Drop the columns separately into a native Word table. Here I can apply formatting, but empty tables will remain.
  • In QlikSense, one table for all categories, where the columns appear only if every row belongs to a given category. In NPrinting I use a level for cycling through the categories. This makes it so that a table only shows when it is non-empty, but again I cannot apply formatting. 

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.

Labels (2)
1 Solution

Accepted Solutions
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @user_qlik_bga 

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.

Lech_Miszkiewicz_0-1765538400930.png

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.

Lech_Miszkiewicz_1-1765539148327.gif

Result: This is GIF so right click on it and open in new window to be able to see it better

Lech_Miszkiewicz_0-1765539082502.gif

I am attaching App and report template for you to play with. 

That should make it very straight forward.

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.

View solution in original post

5 Replies
Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @user_qlik_bga 

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. 

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
user_qlik_bga
Contributor II
Contributor II
Author

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. 

 

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @user_qlik_bga 

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.

Lech_Miszkiewicz_0-1765538400930.png

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.

Lech_Miszkiewicz_1-1765539148327.gif

Result: This is GIF so right click on it and open in new window to be able to see it better

Lech_Miszkiewicz_0-1765539082502.gif

I am attaching App and report template for you to play with. 

That should make it very straight forward.

cheers

Lech

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
user_qlik_bga
Contributor II
Contributor II
Author

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!

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

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

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.