Skip to main content
Announcements
Defect acknowledgement with Nprinting Engine May 2022 SR2, please READ HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

Use variable value in Nprinting

In my Qlik document I have several button that set values to two variables.

based on those two values an expression is selected to  show values in a bar chart.

for example If var1= Y and var2 = Z then sum(sales),

if var1= x and var2 = B then sum(costs) etc. etc

I want to use this bar chart in Nprinting. Is it possible to set static values in Nprinting for these two variables ? In that case thecorrect  expression is used for the values I want to display in the bar chart.

I know I can set a value to a variable that is used for a dimension but I could not find if this can be used for expression too.

 

Labels (2)
1 Solution

Accepted Solutions
curiousfellow
Specialist
Specialist
Author

vCurrentyear is used in the expression or is used to set a dimension value ?

 

View solution in original post

6 Replies
Ruggero_Piccoli
Support
Support

Hi,

In Qlik NPrinting you can use Filters to set the value of a variable. It is documented in https://help.qlik.com/en-US/nprinting/May2021/Content/NPrinting/ReportsDevelopment/Static-dynamic-fi...

Then you can apply the filter as a normal filter to reports, tasks, users or objects.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
Digvijay_Singh

I recently used Variable in the nprinting filter and used that filter as a task filter, it worked perfectly for me. I wanted to show Quarters or months in the bar chart so I created two variable filters in nprinting with different values, and used them in two separate tasks so that same chart can show quarters or months in two different tasks. Not sure if you can do somewhat similar. 

curiousfellow
Specialist
Specialist
Author

As far as I can see in the link, I need to enter a dimension.

So it must be possible to set a value to a variable even if that variable is used in an expression? 

That was what I tried before I started this topic, but I did not get any result. My variable is a textstring, and I tried several options , with or without apostrophes , with or without the '=' sign and with or without the evaluate box checked.

I used the filter in the report settings and in another attempt in the template. But still no results.

 

 

Ruggero_Piccoli
Support
Support

Hi,

I created a filter to set the value of the Variable named Dimension01 to Country. It is a text variable:

Ruggero_Piccoli_1-1651238948637.png

it is used to change a QlikView chart:

Ruggero_Piccoli_3-1651239063212.png

On the same filter I set the value of the vCurentYear variable by calculating it:

Ruggero_Piccoli_2-1651239012389.png

I added the filter to an Excel report template 

Ruggero_Piccoli_4-1651239260476.png

the preview is as expected

Ruggero_Piccoli_5-1651239305869.png

If I change the value of the variable Dimension01 to City

Ruggero_Piccoli_6-1651239355739.png

the preview changes

Ruggero_Piccoli_7-1651239388933.png

I hope this helps.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.
curiousfellow
Specialist
Specialist
Author

vCurrentyear is used in the expression or is used to set a dimension value ?

 

Ruggero_Piccoli
Support
Support

Hi,

In my example vCurrentYear is used just to demonstrate how to set the value of a variable by placing it in the template.

The variable called Dimension01 is used in the QlikView chart to set the first column.

Best Regards,

Ruggero



Best Regards,
Ruggero
---------------------------------------------
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads with a LIKE if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads with LIKEs if you feel additional info is useful to others.