Qlik Community

Qlik NPrinting Discussions

Discussion Board for collaboration on Qlik NPrinting.

Highlighted
Partner
Partner

Best Practice - Changing formulas within Tables without Error in Report

Hello everyone,

I currently have a problem or question.

I have a Qlik Sense application, based on which I create Excel reports in NPrinting.

If I now change a formula within a table, I get an error message when opening the template that a column can no longer be found.

With one or two columns this may not be a problem. I see this as problematic in large applications with multiple tables.

Apart from using master elements, are there other possibilities that I can use in this direction without the fields losing their connection?

Thanks and greetings

1 Solution

Accepted Solutions

Re: Best Practice - Changing formulas within Tables without Error in Report

1. As a general rule for all my nprinting reports i use master objects and i think it is best practice as in some rare situations i experienced issues where not all coumns were coming through.

2. For Master Measures i use variables. Variable contains whole expression in it (for example: sum({<IsTY={1},Country={'Australia},State=>} Sales). Any change to the measure definition is done directly in variable. I keep variables in excel file and i load them during reload

3. Yes i did. Adjusting report after change can be complex. As NPrinitng report is a static report it is not ment to be changed often. If the change is only based on expression definition using variables and master objects can simplify this process as you only change it in Qlik and NPrinitng stays untouched.

by the way. I do not get what do you mean by changing "field by field"

 

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.
8 Replies
Partner
Partner

Re: Best Practice - Changing formulas within Tables without Error in Report

if you use variables you can change these variables without changing the column nprinting is looking for.

Re: Best Practice - Changing formulas within Tables without Error in Report

I take it actually one step further and I use Master Item and within master item i use variable as expression. This prevents it from sometimes funny behaviour when columns are not passed through to NPrinting properly

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.
Partner
Partner

Re: Best Practice - Changing formulas within Tables without Error in Report

Thanks for the answers.

@Lech
You are using a variable within the master elements which contains the actual formula, right?

Did you already have the general case (without master elements) that you had to adjust a report afterwards?

If yes, how could this simply be done, currently I only see the possibility to change field by field.

Re: Best Practice - Changing formulas within Tables without Error in Report

1. As a general rule for all my nprinting reports i use master objects and i think it is best practice as in some rare situations i experienced issues where not all coumns were coming through.

2. For Master Measures i use variables. Variable contains whole expression in it (for example: sum({<IsTY={1},Country={'Australia},State=>} Sales). Any change to the measure definition is done directly in variable. I keep variables in excel file and i load them during reload

3. Yes i did. Adjusting report after change can be complex. As NPrinitng report is a static report it is not ment to be changed often. If the change is only based on expression definition using variables and master objects can simplify this process as you only change it in Qlik and NPrinitng stays untouched.

by the way. I do not get what do you mean by changing "field by field"

 

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.
Partner
Partner

Re: Best Practice - Changing formulas within Tables without Error in Report

Hello Lech,

I'll try to give you an example.

I have a table with 10 fields. I use these 10 fields individually in the designer.

If I now adjust 5 of the 10 fields (i.e. change the formula) I get the error message that this field can no longer be found, because NPrinting links via the field name (or if there is no name, then via the formula).

The only solution I know of is to drag and drop the 5 "customized" fields again.

Hence the question if there is a way to correct this more easily.

Re: Best Practice - Changing formulas within Tables without Error in Report

I think the problem sits in naming. What do you call field?

In Qlik Sense Table you have Dimensions and Measures as shown on picture.

2019-06-12_21-44-43.png

now,

if you are talking about dimensions, then yes - there is no other way but changing it one by one in Qlik Sense and in NPrinting. Dimensions are driving granularity of the data in your table so they fundamentally change the context of the report.

However If you are talking about measure, then measure effectively is an expression. Expression can be incapsulated in variable. Say my variable vSales has now definition Sum(Sales)

2.png

the next step i do is I create a master measure and i use a variable as expression.

3.png

Now i use this master measure in the table which is used in Nprinting. 

If i decide that this measure definition has to change i only have to change content of variable.

 

Thats all.

I do not know if that answers your question, but at the end this is all what you can do to minimize effort required for changes in report.

 

 

 

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.
Partner
Partner

Re: Best Practice - Changing formulas within Tables without Error in Report

Hi Lech,

Thank you for the full explanation.

Field for me means dimension or formula, excuse the bad naming.

You use the variable inside the master elements because you manage the formulas in Excel or is there another reason?

Re: Best Practice - Changing formulas within Tables without Error in Report

yeah, so we have to distinguish between field (dimension/calculated dimension) and measure (formula/expression). That is very important to see a differenece.

Now down the question regarding why I am using variable in master objects - well, i use it because I came from old generation of QlikView users where maintaining expressions in variables is a key. 

You may find online that this is not a good practice anymore: https://qlikcentral.com/2019/05/22/stop-storing-your-qlik-sense-expressions-in-variables/ , but i can argue with this and I have solid grounds to back my approach.

I just find it very convinient to use variables. If I have many measures which depend on each other in Excel file (or DB if it is available) it is much easier for me to track or dependencies and do master updates than directly in Master Objects in Qlik Sense.

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.